summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnderson Lizardo <anderson.lizardo@openbossa.org>2013-05-04 15:39:43 -0400
committerMarcel Holtmann <marcel@holtmann.org>2013-05-08 11:28:44 +0200
commit76c47b98418dc2630767c7cafecad7bf49dd1c27 (patch)
treee3191b5fc04e07ffdba2276b2d22257d7168263d
parent00a878c1b442da7d564e53e7a80040c5300f40a0 (diff)
downloadconnman-76c47b98418dc2630767c7cafecad7bf49dd1c27.tar.gz
connman-76c47b98418dc2630767c7cafecad7bf49dd1c27.tar.bz2
connman-76c47b98418dc2630767c7cafecad7bf49dd1c27.zip
gdbus: Fix using NULL DBusPendingCall when disconnected from D-Bus
From D-Bus documentation for dbus_connection_send_with_reply(): "Warning: if the connection is disconnected or you try to send Unix file descriptors on a connection that does not support them, the DBusPendingCall will be set to NULL, so be careful with this." Fix these errors when killing D-Bus daemon with the client still running: process 5712: arguments to dbus_pending_call_set_notify() were incorrect, assertion "pending != NULL" failed in file ../../dbus/dbus-pending-call.c line 596. This is normally a bug in some application using the D-Bus library. process 5712: arguments to dbus_pending_call_unref() were incorrect, assertion "pending != NULL" failed in file ../../dbus/dbus-pending-call.c line 572. This is normally a bug in some application using the D-Bus library.
-rw-r--r--gdbus/client.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/gdbus/client.c b/gdbus/client.c
index a21b66a1..f700b7ee 100644
--- a/gdbus/client.c
+++ b/gdbus/client.c
@@ -105,6 +105,11 @@ static gboolean modify_match(DBusConnection *conn, const char *member,
return FALSE;
}
+ if (call == NULL) {
+ dbus_message_unref(msg);
+ return FALSE;
+ }
+
dbus_pending_call_set_notify(call, modify_match_reply, NULL, NULL);
dbus_pending_call_unref(call);