From: Ilho Kim Date: Tue, 25 Feb 2020 08:35:34 +0000 (+0900) Subject: Fix memory leak X-Git-Tag: accepted/tizen/unified/20200303.032612~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=14ca82e7fd70be2bdc72223b2f2683d7024bdcb1;p=platform%2Fcore%2Fappfw%2Fapp-installers.git Fix memory leak Change-Id: I3b3b52f983a14a82e5e188b33cdf1acbec495d24 Signed-off-by: Ilho Kim --- diff --git a/src/unit_tests/common/smoke_utils.cc b/src/unit_tests/common/smoke_utils.cc index 7aed360..9320de1 100644 --- a/src/unit_tests/common/smoke_utils.cc +++ b/src/unit_tests/common/smoke_utils.cc @@ -987,6 +987,7 @@ bool CopySmackAccess(const boost::filesystem::path& src, if (!access_label) return true; ret = smack_lsetlabel(dst.c_str(), access_label, SMACK_LABEL_ACCESS); + free(access_label); if (ret < 0) { LOG(ERROR) << "set access label to [" << dst << "] fail"; return false; @@ -1010,6 +1011,7 @@ bool CopySmackExec(const boost::filesystem::path& src, if (!exec_label) return true; ret = smack_lsetlabel(dst.c_str(), exec_label, SMACK_LABEL_EXEC); + free(exec_label); if (ret < 0) { LOG(ERROR) << "set exec label to [" << dst << "] fail"; return false; @@ -1033,6 +1035,7 @@ bool CopySmackMmap(const boost::filesystem::path& src, if (!mmap_label) return true; ret = smack_lsetlabel(dst.c_str(), mmap_label, SMACK_LABEL_MMAP); + free(mmap_label); if (ret < 0) { LOG(ERROR) << "set mmap label to [" << dst << "] fail"; return false;