summaryrefslogtreecommitdiffstats
path: root/common/userpref.c
diff options
context:
space:
mode:
authorGravatar Martin Szulecki2013-10-09 16:54:57 +0200
committerGravatar Martin Szulecki2013-10-09 16:54:57 +0200
commitcece6edafe89bf2fee7d6f63c55765400d97765d (patch)
tree7769ab448d039c9382bd9faf0ccfa2fdf3f6027f /common/userpref.c
parent764384da9f8ed85abf5c22e05ab77acfad010b24 (diff)
downloadlibimobiledevice-cece6edafe89bf2fee7d6f63c55765400d97765d.tar.gz
libimobiledevice-cece6edafe89bf2fee7d6f63c55765400d97765d.tar.bz2
userpref: Free string in internal_set_value() to fix a memory leak
Diffstat (limited to 'common/userpref.c')
-rw-r--r--common/userpref.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/common/userpref.c b/common/userpref.c
index 664ba25..35192ac 100644
--- a/common/userpref.c
+++ b/common/userpref.c
@@ -267,6 +267,8 @@ static int internal_set_value(const char *config_file, const char *key, plist_t
if (plist_get_node_type(value) == PLIST_STRING) {
plist_get_string_val(value, &value_string);
debug_info("setting key %s to %s in config_file %s", key, value_string, config_file);
+ if (value_string)
+ free(value_string);
} else {
debug_info("setting key %s in config_file %s", key, config_file);
}