mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-09 15:50:26 +01:00
libnm-glib: fix crash by taking additional ref in nm-remote-connection/result_cb
result_cb invokes a function pointer provided by the user. Nothing prevents the user from destroying the NMRemoteConnection in the callback, which leads to a crash. Take an additional ref of NMRemoteConnection to keep it alive. This probably caused a crash for nm-applet: https://bugzilla.redhat.com/show_bug.cgi?id=1030403 Signed-off-by: Thomas Haller <thaller@redhat.com>
This commit is contained in:
parent
f93c154161
commit
fbcabeb7f7
1 changed files with 2 additions and 0 deletions
|
|
@ -137,12 +137,14 @@ result_cb (DBusGProxy *proxy, DBusGProxyCall *proxy_call, gpointer user_data)
|
|||
RemoteCall *call = user_data;
|
||||
NMRemoteConnectionResultFunc func = (NMRemoteConnectionResultFunc) call->callback;
|
||||
GError *error = NULL;
|
||||
NMRemoteConnection *self = g_object_ref (call->self);
|
||||
|
||||
dbus_g_proxy_end_call (proxy, proxy_call, &error, G_TYPE_INVALID);
|
||||
if (func)
|
||||
(*func) (call->self, error, call->user_data);
|
||||
g_clear_error (&error);
|
||||
remote_call_complete (call->self, call);
|
||||
g_object_unref (self);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue