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:
Philip Withnall 2015-04-21 23:57:17 +01:00
parent 1b3dbec065
commit bc01109618

View File

@ -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;
}