Fix static analysis issue 27/274227/1
authorIlho Kim <ilho159.kim@samsung.com>
Mon, 25 Apr 2022 04:43:01 +0000 (13:43 +0900)
committerIlho Kim <ilho159.kim@samsung.com>
Mon, 25 Apr 2022 04:56:59 +0000 (13:56 +0900)
- Fix incorrect error log
- Fix memory leak

Change-Id: I5e4a1face1d4f2387454eb5fbb3504325cfb77d6
Signed-off-by: Ilho Kim <ilho159.kim@samsung.com>
src/common/shared_dirs.cc
src/common/step/pkgmgr/step_run_parser_plugins.cc

index 89d3527..982bcde 100644 (file)
@@ -420,7 +420,7 @@ bool PerformExternalDirectoryCreationForUser(uid_t user,
       bf::create_directories(storage_apps_lw_path, error);
       if (error) {
         LOG(ERROR) << "Failed to create directory: "
-                   << storage_apps_path.c_str();
+                   << storage_apps_lw_path.c_str();
         return false;
       }
     }
index 6aa6e86..0dc1b02 100644 (file)
@@ -135,7 +135,7 @@ Step::Status StepRunParserPlugin::undo() {
                         Plugin::ActionType::Undo))
       ret = Status::ERROR;
   } else if (action_type_ == Plugin::ActionType::Upgrade) {
-    plugin_manager_.release();
+    plugin_manager_.reset();
     if (!ProcessPlugins(context_->backup_xml_path.get(),
                         context_->old_manifest_data.get(),
                         Plugin::ActionType::Undo))