From 44f89bb8ade404604867fd270d53a3952ba513df Mon Sep 17 00:00:00 2001 From: Jean-Philippe Andre Date: Tue, 29 Oct 2013 15:03:14 +0900 Subject: [PATCH] evas/cserve2: Fix CID 1039286 (Resource leak) Close socket in case of connection failure. --- src/lib/evas/cserve2/evas_cs2_client.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/lib/evas/cserve2/evas_cs2_client.c b/src/lib/evas/cserve2/evas_cs2_client.c index 5410b0b..0d5fe2c 100644 --- a/src/lib/evas/cserve2/evas_cs2_client.c +++ b/src/lib/evas/cserve2/evas_cs2_client.c @@ -187,6 +187,7 @@ _server_connect(void) if (errno == EACCES) { ERR("not authorized to connect to cserve2!"); + close(s); return EINA_FALSE; } ERR("cserve2 connect failed: [%d] %s. Retrying...", errno, strerror(errno)); @@ -196,6 +197,7 @@ _server_connect(void) if (errno == EINTR) { WRN("received interruption while trying to connect to cserve2!"); + close(s); return EINA_FALSE; } -- 2.7.4