From: Hwankyu Jhun Date: Mon, 7 Nov 2016 11:06:39 +0000 (+0900) Subject: Fix memory leak X-Git-Tag: accepted/tizen/3.0/common/20161114.081549^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F32%2F96032%2F2;p=platform%2Fcore%2Fappfw%2Ftpk-backend.git Fix memory leak Change-Id: I24df29fa7e14840d678af2d8da3d1f1488c28f07 Signed-off-by: Hwankyu Jhun --- diff --git a/src/tpk/step/pkgmgr/step_manifest_adjustment.cc b/src/tpk/step/pkgmgr/step_manifest_adjustment.cc index e26ebd5..3d2ff13 100644 --- a/src/tpk/step/pkgmgr/step_manifest_adjustment.cc +++ b/src/tpk/step/pkgmgr/step_manifest_adjustment.cc @@ -50,6 +50,7 @@ common_installer::Step::Status StepManifestAdjustment::process() { if (attrib == nullptr) { LOG(ERROR) << "Failed to set attribute pkgtype"; + xmlFreeDoc(doc); return Step::Status::ERROR; } @@ -60,11 +61,13 @@ common_installer::Step::Status StepManifestAdjustment::process() { if (attrib == nullptr) { LOG(ERROR) << "Failed to set attribute preload"; + xmlFreeDoc(doc); return Step::Status::ERROR; } if (xmlSaveFile(xml_path_.c_str(), doc) == -1) { LOG(ERROR) << "Failed to modify xml file"; + xmlFreeDoc(doc); return Step::Status::ERROR; }