Remove the possibility of incorrect memory access 67/300867/1
authorilho kim <ilho159.kim@samsung.com>
Fri, 3 Nov 2023 04:22:31 +0000 (13:22 +0900)
committerilho kim <ilho159.kim@samsung.com>
Fri, 3 Nov 2023 04:22:31 +0000 (13:22 +0900)
The pending pkg information by the uninstall request
doesn't have a pkg handle

Change-Id: Ie0341d42c469625bbcec7b0e4be07a9fdc028f06
Signed-off-by: ilho kim <ilho159.kim@samsung.com>
src/server/database/db_handle_provider.cc

index a6b49f1..5576c67 100644 (file)
@@ -518,7 +518,9 @@ void DBHandleProvider::UpdateCrashedWriterPackageInfo(
       pending_app_.erase(app_it);
     }
 
-    AddPackage(std::move(it->second.second));
+    if (it->second.second)
+      AddPackage(std::move(it->second.second));
+
     EraseWriterPID(it->second.first);
     it = pending_pkg_.erase(it);
   }