core: fix OOM checks in dbus-unit
authorThomas Hindoe Paaboel Andersen <phomes@gmail.com>
Tue, 19 May 2015 04:45:52 +0000 (06:45 +0200)
committerThomas Hindoe Paaboel Andersen <phomes@gmail.com>
Tue, 19 May 2015 04:46:59 +0000 (06:46 +0200)
CID#1299014

src/core/dbus-unit.c

index 6d80ea9..1892725 100644 (file)
@@ -716,7 +716,7 @@ static int send_new_signal(sd_bus *bus, void *userdata) {
         assert(u);
 
         p = unit_dbus_path(u);
-        if (!u)
+        if (!p)
                 return -ENOMEM;
 
         r = sd_bus_message_new_signal(
@@ -793,7 +793,7 @@ static int send_removed_signal(sd_bus *bus, void *userdata) {
         assert(u);
 
         p = unit_dbus_path(u);
-        if (!u)
+        if (!p)
                 return -ENOMEM;
 
         r = sd_bus_message_new_signal(