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:
parent
8e00bfc234
commit
2c652b6bfe
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user