diff options
author | Lennart Poettering <lennart@poettering.net> | 2014-10-02 20:37:36 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2014-10-02 20:38:00 +0200 |
commit | 2c652b6bfe816296a5664dae1125e6bb665b9d5e (patch) | |
tree | 2038cc991b5e821562fa09260653662080578335 /src/libsystemd | |
parent | 8e00bfc234f43f49b16aa0124fb4b3f1c8eae4ef (diff) |
kdbus: don't clobber return values, use strjoin() instead of asprintf(), keep function invocations and variable declarations separate
Diffstat (limited to 'src/libsystemd')
-rw-r--r-- | src/libsystemd/sd-bus/bus-kernel.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/libsystemd/sd-bus/bus-kernel.c b/src/libsystemd/sd-bus/bus-kernel.c index 0e74f9136a..0c39e22ed7 100644 --- a/src/libsystemd/sd-bus/bus-kernel.c +++ b/src/libsystemd/sd-bus/bus-kernel.c @@ -1447,11 +1447,15 @@ int bus_kernel_create_endpoint(const char *bus_name, const char *ep_name, char * } if (ep_path) { - int r = asprintf(ep_path, "%s/%s", dirname(path), ep_name); - if (r == -1 || !*ep_path) { + char *p; + + p = strjoin(dirname(path), "/", ep_name, NULL); + if (!p) { safe_close(fd); return -ENOMEM; } + + *ep_path = p; } return fd; |