aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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)))