GNOME Bugzilla – Bug 628564
list_properties() memory leak if no properties
Last modified: 2010-10-30 22:49:43 UTC
Created attachment 169304 [details] failing program, on an object Glib::Object->list_properties() and similar calls on objects or interfaces with no properties leaks memory. The programs obj.pl and iface.pl below use ever more memory. I think the g_free() must be done always, even when n_props==0, per attached diff. I think the returned pspecs array is never empty but always has at least a NULL sentinel. Alas like many details that's not actually described in the glib docs.
Created attachment 169305 [details] failing program, on an interface
Created attachment 169306 [details] [review] patch
Reading the gobject code confirms your conclusions. Committed. Thanks.