resolve memory leak of ip monitor
authorMyungchul Kwak <minus2k@hotmail.com>
Mon, 14 Sep 2015 07:48:36 +0000 (16:48 +0900)
committerPatrick Lankswert <patrick.lankswert@intel.com>
Tue, 15 Sep 2015 17:38:37 +0000 (17:38 +0000)
Resolve memory leak in the IP network monitor of Android & Tizen app.
Calloc'd memory (32bytes) in CANewInterfaceItem(...) fuction is not freed,
and this function is continously called in network monitor thread.
So gradual memory leak is occurred.

Our Android sample app for blockwise-transfer test freezes,
if the app transfers some large data over 10 mins.
(I suppose that this time can be different by device spec.)

Change-Id: Ic6e85acb7c70376c125450c0641b557cc147d39c
Signed-off-by: Myungchul Kwak <minus2k@hotmail.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/2505
Reviewed-by: Ashok Babu Channa <ashok.channa@samsung.com>
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Naga Ashok Jampani <jn.ashok@samsung.com>
Reviewed-by: jihwan seo <jihwan.seo@samsung.com>
Reviewed-by: Jaehong Jo <jaehong.jo@samsung.com>
Reviewed-by: John Light <john.j.light@intel.com>
Reviewed-by: Patrick Lankswert <patrick.lankswert@intel.com>
resource/csdk/connectivity/src/ip_adapter/caipserver.c

index fd0f166..e9bfd57 100644 (file)
@@ -201,6 +201,7 @@ static void CASelectReturned(fd_set *readFds, int ret)
             if (ifchanged)
             {
                 CAProcessNewInterface(ifchanged);
+                OICFree(ifchanged);
             }
             break;
         }