From cece6edafe89bf2fee7d6f63c55765400d97765d Mon Sep 17 00:00:00 2001 From: Martin Szulecki Date: Wed, 9 Oct 2013 16:54:57 +0200 Subject: userpref: Free string in internal_set_value() to fix a memory leak --- common/userpref.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'common/userpref.c') 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); } -- cgit v1.1-32-gdbae