Hi,
Mario Torre wrote:
Il giorno dom, 24/09/2006 alle 21.09 +0200, Mario Torre ha scritto:
Thomas Fitzsimmons kindly reviewed my patch on #classpath.
As a result, this a little update (hope I'm not missing something,
please let me know in this case).
I have removed the call to g_strdup_printf completely, I assume that it
is safe, as gconf_escape_key already returns a newly allocate and
stripped string.
You're still using g_strdup_printf here:
@@ -211,6 +211,7 @@
const char *_val = gconf_entry_get_key (tmp->data);
_val = strrchr (_val, '/');
++_val;
+ _val = g_strdup_printf("%s", gconf_unescape_key(_val, strlen(_val)));
(*env)->CallBooleanMethod (env, jlist, jlist_add_id,
(*env)->NewStringUTF (env, _val));
tmp = g_slist_next (tmp);
[...]
and here:
++_val;
+ _val = g_strdup_printf("%s", gconf_unescape_key(_val, strlen(_val)));
(*env)->CallBooleanMethod (env, jlist, jlist_add_id,
(*env)->NewStringUTF (env, _val));
Since you're not freeing _val, this is a memory leak.
Tom