mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-28 13:10:19 +00:00
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>
This commit is contained in:
parent
969ab7f121
commit
597a3677e9
1 changed files with 2 additions and 2 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue