Skip to content

Commit

Permalink
ui/dbus: fix leak on message filtering
Browse files Browse the repository at this point in the history
A filter function that wants to drop a message should return NULL, in
which case it must also unref the message itself.

Fixes: fa88b85 ("ui/dbus: filter out pending messages when scanout")

Signed-off-by: Marc-André Lureau <[email protected]>
Reviewed-by: Akihiko Odaki <[email protected]>
Message-ID: <[email protected]>
(cherry picked from commit 244d52f)
Signed-off-by: Michael Tokarev <[email protected]>
  • Loading branch information
elmarco authored and Michael Tokarev committed Oct 16, 2024
1 parent 6d03242 commit 9391f41
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions ui/dbus-listener.c
Original file line number Diff line number Diff line change
Expand Up @@ -1001,6 +1001,7 @@ dbus_filter(GDBusConnection *connection,
serial = g_dbus_message_get_serial(message);
if (serial <= ddl->out_serial_to_discard) {
trace_dbus_filter(serial, ddl->out_serial_to_discard);
g_object_unref(message);
return NULL;
}

Expand Down

0 comments on commit 9391f41

Please sign in to comment.