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 662411 - GDBusMessage: fix leak of GError
GDBusMessage: fix leak of GError
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: gdbus
unspecified
Other All
: Normal normal
: ---
Assigned To: David Zeuthen (not reading bugmail)
gtkdev
Depends on:
Blocks:
 
 
Reported: 2011-10-21 18:09 UTC by Allison Karlitskaya (desrt)
Modified: 2011-10-21 19:20 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
GDBusMessage: fix leak of GError (1.31 KB, patch)
2011-10-21 18:09 UTC, Allison Karlitskaya (desrt)
committed Details | Review

Description Allison Karlitskaya (desrt) 2011-10-21 18:09:52 UTC
As part of the deserialisation process of a zero-length array in the
DBus wire format, parse_value_from_blob() recursively calls itself with
the expectation of failing (as can be seen by the assert immediately
following).

It passes &local_error to this always-failing call and then fails to
free it (indeed, to use it at all).  The result is that the GError is
leaked.

Fix it by passing in NULL instead, so that the GError is never created
in the first place.
Comment 1 Allison Karlitskaya (desrt) 2011-10-21 18:09:54 UTC
Created attachment 199680 [details] [review]
GDBusMessage: fix leak of GError
Comment 2 Matthias Clasen 2011-10-21 19:01:47 UTC
Review of attachment 199680 [details] [review]:

Sure, looks right.
Comment 3 David Zeuthen (not reading bugmail) 2011-10-21 19:06:49 UTC
Yeah, go for it (2.28 and 2.30 branches too, please). Thanks
Comment 4 Allison Karlitskaya (desrt) 2011-10-21 19:19:59 UTC
I pushed to master and glib-2-30, but it didn't apply to glib-2-28 and I'm lazy. :)

Attachment 199680 [details] pushed as 9c07e7d - GDBusMessage: fix leak of GError