mirror of
https://github.com/systemd/systemd.git
synced 2024-10-28 03:25:31 +03:00
Fix resource leak (coverity CID 1237760)
This commit is contained in:
parent
8c84621c25
commit
4edf33d1e3
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user