GNOME Bugzilla – Bug 587415
g_resolver_lookup_by_name_finish returns a freed list
Last modified: 2009-06-30 22:49:18 UTC
When unsetting the res_gpointer in g_resolver_lookup_by_name_finish , the associated DestroyNotify function is called (g_resolver_free_addresses) and so it returns a freed list. According to the doc, user is supposed to free the list himself.
Created attachment 137611 [details] [review] proposed fix in this branch: http://git.collabora.co.uk/?p=user/cassidy/glib;a=shortlog;h=refs/heads/resolver-fix gio/gresolver.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
Created attachment 137630 [details] [review] Fix GResolver for g_simple_async_result_set_op_res_gpointer change That patch will leak the data if the caller just unrefs the result rather than calling the finish function (which is allowed). This should fix both cases.
Indeed; your fix is better.
committed