aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPřemysl Janouch <p.janouch@gmail.com>2015-02-14 08:37:41 +0100
committerPřemysl Janouch <p.janouch@gmail.com>2015-02-14 08:37:41 +0100
commit8de88140f54ebcfeab1d2962c115e1fdf6f8c3f0 (patch)
treebfbaab2748a891aba06e4c754c4eadbfb7fc17f1
parent71aca1ad157dabd5cc0bef8060022d60a637c605 (diff)
downloadponymap-8de88140f54ebcfeab1d2962c115e1fdf6f8c3f0.tar.gz
ponymap-8de88140f54ebcfeab1d2962c115e1fdf6f8c3f0.tar.xz
ponymap-8de88140f54ebcfeab1d2962c115e1fdf6f8c3f0.zip
Fix resource leak
-rw-r--r--ponymap.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/ponymap.c b/ponymap.c
index 1ab521a..c7f1b71 100644
--- a/ponymap.c
+++ b/ponymap.c
@@ -720,9 +720,12 @@ unit_make (struct target *target, uint32_t ip, uint16_t port,
else if (errno == EINPROGRESS)
connected = false;
else
+ {
+ xclose (socket_fd);
return errno == EADDRNOTAVAIL
? UNIT_MAKE_TRY_AGAIN
: UNIT_MAKE_ERROR;
+ }
struct unit *u;
if (!(u = unit_new (target, socket_fd, port, service, transport)))