bus: fix memory leak when kdbus is not enabled
authorLennart Poettering <lennart@poettering.net>
Thu, 13 Mar 2014 19:00:50 +0000 (20:00 +0100)
committerLennart Poettering <lennart@poettering.net>
Thu, 13 Mar 2014 19:01:17 +0000 (20:01 +0100)
src/libsystemd/sd-bus/sd-bus.c

index ffa3369..ca7c428 100644 (file)
@@ -1189,7 +1189,8 @@ _public_ int sd_bus_open_user(sd_bus **ret) {
 #ifdef ENABLE_KDBUS
                         asprintf(&b->address, KERNEL_USER_BUS_FMT, (unsigned long) getuid());
 #else
-                        return -ECONNREFUSED;
+                        r = -ECONNREFUSED;
+                        goto fail;
 #endif
                 }