Fix memory leak in Thing-Manager SampleAPP for Tizen Platform
authorJamal Haidar <jamal.haidar@samsung.com>
Tue, 16 Jun 2015 13:45:15 +0000 (19:15 +0530)
committerUze Choi <uzchoi@samsung.com>
Fri, 19 Jun 2015 08:56:53 +0000 (08:56 +0000)
In "onObserve" function locally malloc char* buf is not freed, which
creates a possible memory leak.

Change-Id: Ie8a6e6b31f580ffd4bc66c13f8f1dc3c3429a8c3
Signed-off-by: Jamal Haidar <jamal.haidar@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/1283
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Harish Marappa <h.marappa@samsung.com>
Reviewed-by: Uze Choi <uzchoi@samsung.com>
service/things-manager/sampleapp/tizen/TMSampleApp/src/group.cpp

index 3175137..e8924bd 100644 (file)
@@ -593,6 +593,7 @@ void onObserve(const HeaderOptions headerOptions, const OCRepresentation &rep, c
         }
         sprintf(buf, "%d", level);
         logMessage += "level:" + string(buf) + "<br>";
+        free(buf);
     }
     else
     {