mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-03-28 02:20:04 +01:00
gdbusdaemon: Add an assertion to help static analysis of refcounts
This should fix a scan-build warning about the final `name_unref()` here being a use-after-free. Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
This commit is contained in:
parent
86927c39e0
commit
7767978725
@ -874,7 +874,11 @@ client_free (Client *client)
|
||||
name_ref (name);
|
||||
|
||||
if (name->owner && name->owner->client == client)
|
||||
name_release_owner (name);
|
||||
{
|
||||
/* Help static analysers with the refcount at this point. */
|
||||
g_assert (name->refcount >= 2);
|
||||
name_release_owner (name);
|
||||
}
|
||||
|
||||
name_unqueue_owner (name, client);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user