Fix memory leak 32/96032/2 accepted/tizen/3.0/common/20161114.081549 accepted/tizen/3.0/ivi/20161110.015555 accepted/tizen/3.0/mobile/20161110.015326 accepted/tizen/3.0/tv/20161110.015434 accepted/tizen/3.0/wearable/20161110.015526 submit/tizen_3.0/20161107.133644 submit/tizen_3.0_common/20161110.084657
authorHwankyu Jhun <h.jhun@samsung.com>
Mon, 7 Nov 2016 11:06:39 +0000 (20:06 +0900)
committerjongmyeong ko <jongmyeong.ko@samsung.com>
Mon, 7 Nov 2016 12:44:27 +0000 (04:44 -0800)
Change-Id: I24df29fa7e14840d678af2d8da3d1f1488c28f07
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
src/tpk/step/pkgmgr/step_manifest_adjustment.cc

index e26ebd5..3d2ff13 100644 (file)
@@ -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;
   }