mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-12-25 15:06:14 +01:00
gdbusmessage: Fix a minor memory leak on an error path
If g_dbus_message_to_blob() fails at all, it will leak its mbuf. Spotted by running the gdbus-serialization test under Valgrind — so there is a justification for leak-free tests after all!
This commit is contained in:
parent
1b3dbec065
commit
bc01109618
@ -2745,6 +2745,9 @@ g_dbus_message_to_blob (GDBusMessage *message,
|
||||
ret = (guchar *)mbuf.data;
|
||||
|
||||
out:
|
||||
if (ret == NULL)
|
||||
g_free (mbuf.data);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user