evas/cserve2: Fix CID 1039286 (Resource leak)
authorJean-Philippe Andre <jp.andre@samsung.com>
Tue, 29 Oct 2013 06:03:14 +0000 (15:03 +0900)
committerJean-Philippe Andre <jp.andre@samsung.com>
Tue, 29 Oct 2013 06:08:19 +0000 (15:08 +0900)
Close socket in case of connection failure.

src/lib/evas/cserve2/evas_cs2_client.c

index 5410b0b..0d5fe2c 100644 (file)
@@ -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;
           }