Return a copy of a string in ghashtable configuration module.
authorThadeu Lima de Souza Cascardo <cascardo@holoscopio.com>
Sat, 7 Feb 2009 01:37:41 +0000 (23:37 -0200)
committerThadeu Lima de Souza Cascardo <cascardo@holoscopio.com>
Sat, 7 Feb 2009 01:37:41 +0000 (23:37 -0200)
Since gkeyfile module returns a string copy that must be freed, other
modules must do as well, to avoid releasing a static or stack string or
double-freeing a dynamic one.

config/ghashtable/ghashtable.c

index ab32036..f5a946b 100644 (file)
@@ -75,7 +75,7 @@ ghashtable_atom_config_get_str (AtomCtx *ctx, gchar *group, gchar * key)
       atom_error_message_set (aerr, "Could not find configuration value");
       atom_error_set (ctx, aerr);
     }
-  return value;
+  return g_strdup (value);
 }
 
 AtomConfig *