summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Herrmann <dh.herrmann@gmail.com>2015-07-31 11:51:33 +0200
committerDavid Herrmann <dh.herrmann@gmail.com>2015-07-31 11:52:21 +0200
commit0810bc568ace619b16e440805e93256730d45541 (patch)
treed9178d9ac5b804323ccc7959769a7acb7b8d7b78
parent6189e043d41b5d5eaec11d6a5ab06b5f35c0ddf7 (diff)
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.
-rw-r--r--src/basic/socket-util.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/basic/socket-util.c b/src/basic/socket-util.c
index 62f99b322e..8fd3149276 100644
--- a/src/basic/socket-util.c
+++ b/src/basic/socket-util.c
@@ -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;
}