diff options
author | Martin Szulecki | 2013-10-09 16:54:57 +0200 |
---|---|---|
committer | Martin Szulecki | 2013-10-09 16:54:57 +0200 |
commit | cece6edafe89bf2fee7d6f63c55765400d97765d (patch) | |
tree | 7769ab448d039c9382bd9faf0ccfa2fdf3f6027f | |
parent | 764384da9f8ed85abf5c22e05ab77acfad010b24 (diff) | |
download | libimobiledevice-cece6edafe89bf2fee7d6f63c55765400d97765d.tar.gz libimobiledevice-cece6edafe89bf2fee7d6f63c55765400d97765d.tar.bz2 |
userpref: Free string in internal_set_value() to fix a memory leak
-rw-r--r-- | common/userpref.c | 2 |
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); } |