summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/libsystemd/sd-bus/sd-bus.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/libsystemd/sd-bus/sd-bus.c b/src/libsystemd/sd-bus/sd-bus.c
index 78e91b9654..83b3aa1c3c 100644
--- a/src/libsystemd/sd-bus/sd-bus.c
+++ b/src/libsystemd/sd-bus/sd-bus.c
@@ -3339,8 +3339,10 @@ _public_ int sd_bus_get_peer_creds(sd_bus *bus, uint64_t mask, sd_bus_creds **re
}
r = bus_creds_add_more(c, mask, pid, 0);
- if (r < 0)
+ if (r < 0) {
+ sd_bus_creds_unref(c);
return r;
+ }
*ret = c;
return 0;