mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-31 13:24:13 +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:
@@ -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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user