From: ilho kim Date: Fri, 3 Nov 2023 04:22:31 +0000 (+0900) Subject: Remove the possibility of incorrect memory access X-Git-Tag: accepted/tizen/unified/20231103.163818~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;ds=sidebyside;h=434d13dc56657c25c3a3b709e1ae59e22842c5a0;p=platform%2Fcore%2Fappfw%2Fpkgmgr-info.git Remove the possibility of incorrect memory access The pending pkg information by the uninstall request doesn't have a pkg handle Change-Id: Ie0341d42c469625bbcec7b0e4be07a9fdc028f06 Signed-off-by: ilho kim --- diff --git a/src/server/database/db_handle_provider.cc b/src/server/database/db_handle_provider.cc index a6b49f1..5576c67 100644 --- a/src/server/database/db_handle_provider.cc +++ b/src/server/database/db_handle_provider.cc @@ -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); }