chiark / gitweb /
bus: close a bus that failed to connect
authorLennart Poettering <lennart@poettering.net>
Wed, 2 Jul 2014 23:19:21 +0000 (01:19 +0200)
committerLennart Poettering <lennart@poettering.net>
Wed, 2 Jul 2014 23:19:21 +0000 (01:19 +0200)
src/libsystemd/sd-bus/sd-bus.c

index c25375c..28fc19e 100644 (file)
@@ -1033,8 +1033,10 @@ _public_ int sd_bus_start(sd_bus *bus) {
         else
                 return -EINVAL;
 
-        if (r < 0)
+        if (r < 0) {
+                sd_bus_close(bus);
                 return r;
+        }
 
         return bus_send_hello(bus);
 }