summaryrefslogtreecommitdiffstats
path: root/gtk-gui.c
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2012-12-12 07:23:04 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2012-12-12 07:24:07 -0800
commit597a3677e9025a41eb84fa1741721d9b0bd89f63 (patch)
treee9be9e5b6c995e67c033384bae75b79ec78ea90c /gtk-gui.c
parent969ab7f121564b3918b92e1d88cd6b13cb83122b (diff)
downloadsubsurface-597a3677e9025a41eb84fa1741721d9b0bd89f63.tar.gz
Ensure default dive computer strings can be freed
We don't want to directly use the strings returned to us from libdivecomputer. Fixes bug 34 Reported-by: Sergey Starosek <sergey.starosek@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'gtk-gui.c')
-rw-r--r--gtk-gui.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gtk-gui.c b/gtk-gui.c
index c7087acce..9104aef57 100644
--- a/gtk-gui.c
+++ b/gtk-gui.c
@@ -74,8 +74,8 @@ static void set_default_dive_computer(const char *vendor, const char *product)
free((void *)default_dive_computer_vendor);
if (default_dive_computer_product)
free((void *)default_dive_computer_product);
- default_dive_computer_vendor = vendor;
- default_dive_computer_product = product;
+ default_dive_computer_vendor = strdup(vendor);
+ default_dive_computer_product = strdup(product);
subsurface_set_conf("dive_computer_vendor", PREF_STRING, vendor);
subsurface_set_conf("dive_computer_product", PREF_STRING, product);
}