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:
David Herrmann 2015-07-31 11:51:33 +02:00
parent 6189e043d4
commit 0810bc568a

View file

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