After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 654069 - memory leak in giconstantinfo.c
memory leak in giconstantinfo.c
Status: RESOLVED FIXED
Product: gobject-introspection
Classification: Platform
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gobject-introspection Maintainer(s)
gobject-introspection Maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2011-07-06 06:34 UTC by Jasper St. Pierre (not reading bugmail)
Modified: 2015-02-07 16:49 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
giconstantinfo: Add API to fix memory leak (2.47 KB, patch)
2011-10-05 20:38 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review
repo: Fix memory leak (1.64 KB, patch)
2011-10-05 20:39 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review

Description Jasper St. Pierre (not reading bugmail) 2011-07-06 06:34:05 UTC
in g_constant_info_get_value, we do this:

      if (blob->type.flags.pointer)
	value->v_pointer = g_memdup (&rinfo->typelib->data[blob->offset], blob->size);

but we never free the dup'd memory! should we have a g_constant_info_cleanup that decides if has a pointer and then clean up the dup'd memory, and use that?
Comment 1 Jasper St. Pierre (not reading bugmail) 2011-10-05 20:38:51 UTC
Created attachment 198375 [details] [review]
giconstantinfo: Add API to fix memory leak
Comment 2 Jasper St. Pierre (not reading bugmail) 2011-10-05 20:39:10 UTC
Created attachment 198376 [details] [review]
repo: Fix memory leak

gjs patch to do the same
Comment 3 Colin Walters 2011-10-05 20:42:49 UTC
Review of attachment 198375 [details] [review]:

Looks right.
Comment 4 Colin Walters 2011-10-05 20:43:25 UTC
Review of attachment 198376 [details] [review]:

I'd say "Fix a memory leak looking up constants"
Comment 5 Colin Walters 2011-10-05 20:44:05 UTC
Review of attachment 198375 [details] [review]:

Oh actually

::: girepository/giconstantinfo.c
@@ +74,3 @@
+ * @value: the argument
+ *
+ * Free the value returned from g_constant_info_get_value().

Actually could you add a:

Since: 1.30.1
Comment 6 Jasper St. Pierre (not reading bugmail) 2011-10-05 20:46:48 UTC
Comment on attachment 198375 [details] [review]
giconstantinfo: Add API to fix memory leak

Attachment 198375 [details] pushed as 8e970f4 - giconstantinfo: Add API to fix memory leak
Comment 7 Jasper St. Pierre (not reading bugmail) 2011-10-05 20:47:27 UTC
Attachment 198376 [details] pushed as 8ba8bb3 - repo: Fix memory leak


Pushed with suggested annotation change. Thanks!
Comment 8 André Klapper 2015-02-07 16:49:54 UTC
[Mass-moving gobject-introspection tickets to its own Bugzilla product - see bug 708029. Mass-filter your bugmail for this message: introspection20150207 ]