From: Hwankyu Jhun Date: Tue, 4 Apr 2023 22:55:30 +0000 (+0000) Subject: Fix static analysis issues X-Git-Tag: accepted/tizen/unified/20230406.165738~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F02%2F290902%2F1;p=platform%2Fcore%2Fappfw%2Flaunchpad.git Fix static analysis issues Fixed: - resource leak - forward null Change-Id: I24116eb324737cdb27f1780d8fed244a3458d9fc Signed-off-by: Hwankyu Jhun --- diff --git a/src/launchpad-process-pool/launchpad.cc b/src/launchpad-process-pool/launchpad.cc index 4634cfc..6885aed 100644 --- a/src/launchpad-process-pool/launchpad.cc +++ b/src/launchpad-process-pool/launchpad.cc @@ -2463,6 +2463,7 @@ void Launchpad::HandlePrepareAppDefinedLoaderRequest( if (context == nullptr) { _E("Out of memory"); request->SendResult(-ENOMEM); + return; } } else { loader_id = context->loader_id; @@ -2666,8 +2667,10 @@ void Launchpad::OnIOEventReceived(int fd, int condition) { auto pkt_auto = std::unique_ptr( pkt, std::free); auto* kb = bundle_decode(pkt->data, pkt->len); - if (kb == nullptr) + if (kb == nullptr) { + close(client_fd); return; + } tizen_base::Bundle b(kb, false, true); auto request = std::make_shared(