From 691b75f75dd67be17024664a849630d1f1caa29b Mon Sep 17 00:00:00 2001 From: Erich Keane Date: Fri, 12 Jun 2015 09:55:05 -0700 Subject: [PATCH] Fixed memory leak in OICStrdup test OICStrdup test didn't release its result memory, this fix ensures that it is properly released. Change-Id: Ieb271c5fbace45a730905de4dd02f2208bbf42e5 Signed-off-by: Erich Keane Reviewed-on: https://gerrit.iotivity.org/gerrit/1259 Tested-by: jenkins-iotivity --- resource/c_common/oic_string/test/linux/oic_string_tests.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/resource/c_common/oic_string/test/linux/oic_string_tests.cpp b/resource/c_common/oic_string/test/linux/oic_string_tests.cpp index 3c825ad..77f95ab 100644 --- a/resource/c_common/oic_string/test/linux/oic_string_tests.cpp +++ b/resource/c_common/oic_string/test/linux/oic_string_tests.cpp @@ -36,6 +36,7 @@ #include "gtest/gtest.h" #include +#include const char SENTINEL_VALUE = 127; TEST(StringTests, StrdupNormalDup) @@ -50,6 +51,8 @@ TEST(StringTests, StrdupNormalDup) EXPECT_NE(param, result); EXPECT_STREQ(param, result); + + OICFree(result); } // Tests a normal copy where the buffer is exactly long enough -- 2.7.4