1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-05 06:52:22 +03:00

kdbus: don't clobber return values, use strjoin() instead of asprintf(), keep function invocations and variable declarations separate

This commit is contained in:
Lennart Poettering 2014-10-02 20:37:36 +02:00
parent 8e00bfc234
commit 2c652b6bfe

View File

@ -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;