mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-12-25 23:16:14 +01:00
Don't leak an error
The previous commit introduced a possible memory leak in cases where we get a G_IO_ERROR_CLOSED error. Make sure to always free an error, if we got one. https://bugzilla.gnome.org/show_bug.cgi?id=753278
This commit is contained in:
parent
b3fcb1442e
commit
905e916573
@ -929,9 +929,10 @@ g_dbus_object_manager_server_emit_interfaces_added (GDBusObjectManagerServer *ma
|
||||
object_path,
|
||||
&array_builder),
|
||||
&error);
|
||||
if (error && !g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CLOSED))
|
||||
if (error)
|
||||
{
|
||||
g_warning ("Couldn't emit InterfacesAdded signal: %s", error->message);
|
||||
if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CLOSED))
|
||||
g_warning ("Couldn't emit InterfacesAdded signal: %s", error->message);
|
||||
g_error_free (error);
|
||||
}
|
||||
out:
|
||||
@ -966,9 +967,10 @@ g_dbus_object_manager_server_emit_interfaces_removed (GDBusObjectManagerServer *
|
||||
object_path,
|
||||
&array_builder),
|
||||
&error);
|
||||
if (error && !g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CLOSED))
|
||||
if (error)
|
||||
{
|
||||
g_warning ("Couldn't emit InterfacesRemoved signal: %s", error->message);
|
||||
if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CLOSED))
|
||||
g_warning ("Couldn't emit InterfacesRemoved signal: %s", error->message);
|
||||
g_error_free (error);
|
||||
}
|
||||
out:
|
||||
|
Loading…
Reference in New Issue
Block a user