From be1c3830ca5cc7f82edf48087522453413e71528 Mon Sep 17 00:00:00 2001
From: David Herrmann <dh.herrmann@gmail.com>
Date: Fri, 31 Jul 2015 11:51:33 +0200
Subject: [PATCH] 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.
(cherry picked from commit 0810bc568ace619b16e440805e93256730d45541)
---
src/shared/socket-util.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/shared/socket-util.c b/src/shared/socket-util.c
index a4e26b1d8c..407d0afee3 100644
--- a/src/shared/socket-util.c
+++ b/src/shared/socket-util.c
@@ -544,7 +544,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;
}