chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
b67ddc7
)
bus: unref buscreds on failure
author
Philippe De Swert
<philippedeswert@gmail.com>
Wed, 10 Sep 2014 09:20:42 +0000
(12:20 +0300)
committer
David Herrmann
<dh.herrmann@gmail.com>
Thu, 11 Sep 2014 15:29:19 +0000
(17:29 +0200)
Actually unref the buscreds when we are not going to return a
pointer to them. As when bus_creds_add_more fails we immediately
return the error code otherwise and leak the new buscreds.
Found with coverity. Fixes: CID#
1237761
src/libsystemd/sd-bus/sd-bus.c
patch
|
blob
|
history
diff --git
a/src/libsystemd/sd-bus/sd-bus.c
b/src/libsystemd/sd-bus/sd-bus.c
index 78e91b96541809ef35e13d0b5edf0ac55ab8c890..83b3aa1c3c46837f325c72047ab45fc1be3e6252 100644
(file)
--- 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;