mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-06-19 10:44:49 +02: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;
|
ret = (guchar *)mbuf.data;
|
||||||
|
|
||||||
out:
|
out:
|
||||||
|
if (ret == NULL)
|
||||||
|
g_free (mbuf.data);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user