Fix formatting/double free() 72/61972/2
authorTomasz Iwanek <t.iwanek@samsung.com>
Fri, 11 Mar 2016 14:52:20 +0000 (15:52 +0100)
committerSangyoon Jang <s89.jang@samsung.com>
Mon, 14 Mar 2016 04:49:07 +0000 (21:49 -0700)
manifest->tep_name is freed in pkgmgr.

Change-Id: Ic6720169d01262fb0089a90759d072d448af9bbc

src/common/step/step_parse_manifest.cc
src/common/utils/base64.cc

index acab4a5..2cb8e09 100644 (file)
@@ -806,7 +806,7 @@ Step::Status StepParseManifest::process() {
   }
 
   if (!context_->tep_path.get().empty())
-    manifest->tep_name = (char *)context_->tep_path.get().c_str();
+    manifest->tep_name = strdup(context_->tep_path.get().c_str());
 
   // write pkgid for recovery file
   if (context_->recovery_info.get().recovery_file) {
index 1e1f08d..840f506 100644 (file)
@@ -7,6 +7,7 @@
 #include <boost/archive/iterators/base64_from_binary.hpp>
 #include <boost/archive/iterators/transform_width.hpp>
 
+#include <algorithm>
 #include <sstream>
 #include <string>