libdbus-p2p: fix a memory error 38/270038/1
authorMichal Bloch <m.bloch@samsung.com>
Mon, 24 Jan 2022 17:39:50 +0000 (18:39 +0100)
committerMichal Bloch <m.bloch@samsung.com>
Mon, 24 Jan 2022 17:39:50 +0000 (18:39 +0100)
Change-Id: Ibd6adc341610e59ba0432fcd89b30cef609fdc24
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
benchmark/libdbus-p2p-server.cpp

index 0540dfd4f37cf71a1c6cab7572723d0534a0f030..f231e5a7e8062924e473dd887da86ce79a03291c 100644 (file)
@@ -297,6 +297,9 @@ void dispatch_connection (conn_with_metadata & cwm, bool busy_wait)
 
 struct DBusServer_deleter {
        void operator () (DBusServer * server) {
+               if (!server)
+                       return;
+
                dbus_server_disconnect (server);
                dbus_server_unref (server);
        }