From 8de88140f54ebcfeab1d2962c115e1fdf6f8c3f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C5=99emysl=20Janouch?= Date: Sat, 14 Feb 2015 08:37:41 +0100 Subject: Fix resource leak --- ponymap.c | 3 +++ 1 file changed, 3 insertions(+) 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))) -- cgit v1.2.3