mirror of
https://github.com/systemd/systemd.git
synced 2024-11-06 16:59:03 +03:00
basic: fix error/memleak in socket-util
Probably a typo, checking 'ret' instead of the return value 'p'. This might cause the function to return failure, even though it succeeded. Furthermore, it might leak resources.
This commit is contained in:
parent
6189e043d4
commit
0810bc568a
@ -583,7 +583,7 @@ int sockaddr_pretty(const struct sockaddr *_sa, socklen_t salen, bool translate_
|
||||
|
||||
} else {
|
||||
p = strndup(sa->un.sun_path, sizeof(sa->un.sun_path));
|
||||
if (!ret)
|
||||
if (!p)
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user