[systemd-commits] src/libsystemd
Daniel Mack
zonque at kemper.freedesktop.org
Thu Sep 18 01:14:40 PDT 2014
src/libsystemd/sd-bus/bus-kernel.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
New commits:
commit 4edf33d1e3fb551b1b0cee8e4a2a380c71b00dc7
Author: Cristian RodrÃguez <crrodriguez at opensuse.org>
Date: Wed Sep 17 18:10:21 2014 -0300
Fix resource leak (coverity CID 1237760)
diff --git a/src/libsystemd/sd-bus/bus-kernel.c b/src/libsystemd/sd-bus/bus-kernel.c
index 505f335..b3cc996 100644
--- a/src/libsystemd/sd-bus/bus-kernel.c
+++ b/src/libsystemd/sd-bus/bus-kernel.c
@@ -1446,9 +1446,11 @@ int bus_kernel_create_endpoint(const char *bus_name, const char *ep_name, char *
}
if (ep_path) {
- asprintf(ep_path, "%s/%s", dirname(path), ep_name);
- if (!*ep_path)
+ int r = asprintf(ep_path, "%s/%s", dirname(path), ep_name);
+ if (r == -1 || !*ep_path) {
+ safe_close(fd);
return -ENOMEM;
+ }
}
return fd;
More information about the systemd-commits
mailing list