[CONPRO-1591]:Crash in libconnectivity_abstraction.so [CAIPStopServer] 34/236734/1
authorSourav Bhuwalka <s.bhuwalka@samsung.com>
Wed, 27 May 2020 22:55:07 +0000 (04:25 +0530)
committerSudipto <sudipto.bal@samsung.com>
Fri, 19 Jun 2020 17:10:38 +0000 (22:40 +0530)
Setting the value of caglobals.ip.shutdownFds[1] to -1 to avoid
double closure of the same socket

https://github.sec.samsung.net/RS7-IOTIVITY/IoTivity/pull/706
(cherry-picked from 3dfe9fb3db7945b50a663a7ff545e11b576c1cfe)

Change-Id: Ia46a971ebdc834433f528986b3c772487f06c60c
Signed-off-by: Sourav Bhuwalka <s.bhuwalka@samsung.com>
Signed-off-by: Sudipto <sudipto.bal@samsung.com>
resource/csdk/connectivity/src/ip_adapter/caipserver.c

index 04a3495..375c26d 100644 (file)
@@ -1181,6 +1181,7 @@ void CAIPStopServer()
     if (caglobals.ip.shutdownFds[1] != -1)
     {
         close(caglobals.ip.shutdownFds[1]);
+        caglobals.ip.shutdownFds[1] = -1;
         // receive thread will stop immediately
     }
     else