Commit 59f2d96c authored by Adam Jackson's avatar Adam Jackson 🥃 Committed by David Zeuthen

PolkitAgent: Avoid crashing if initializing the server object fails

Note that otherwise we return a freed server object.  Since later in
polkit_agent_listener_register_with_options we check against NULL to
determine failure, this makes for sad times later when we call
server_free() on it again.

https://bugs.freedesktop.org/show_bug.cgi?id=55776Signed-off-by: David Zeuthen's avatarDavid Zeuthen <zeuthen@gmail.com>
parent fa042232
......@@ -260,10 +260,9 @@ server_new (PolkitSubject *subject,
if (!server_init_sync (server, cancellable, error))
{
server_free (server);
goto out;
return NULL;
}
out:
return server;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment