Fix memory leak 66/151666/1
authorJunghyun Yeon <jungh.yeon@samsung.com>
Thu, 21 Sep 2017 11:24:03 +0000 (20:24 +0900)
committerJunghyun Yeon <jungh.yeon@samsung.com>
Thu, 21 Sep 2017 11:24:03 +0000 (20:24 +0900)
- Newly allocated manifest variable is not assigned at installer context
  at that time and it will be leaked if any of function calls in
  FillManifestX has failed.

Change-Id: I33c4525d37a2f9a3a19074288246ce6e06af749a
Signed-off-by: Junghyun Yeon <jungh.yeon@samsung.com>
src/common/step/configuration/step_parse_manifest.cc

index 0816899..767957c 100644 (file)
@@ -1179,6 +1179,7 @@ Step::Status StepParseManifest::process() {
   if (!FillManifestX(const_cast<manifest_x*>(manifest))) {
     LOG(ERROR) << "[Parse] Storing manifest_x failed. "
                <<  parser_->GetErrorMessage();
+    pkgmgr_parser_free_manifest_xml(manifest);
     return Step::Status::PARSE_ERROR;
   }