From 48c48d14003444e22a30c7f8d30be6806fb62b95 Mon Sep 17 00:00:00 2001 From: Hwankyu Jhun Date: Tue, 4 Apr 2023 22:55:30 +0000 Subject: [PATCH] Fix static analysis issues Fixed: - resource leak - forward null Change-Id: I24116eb324737cdb27f1780d8fed244a3458d9fc Signed-off-by: Hwankyu Jhun --- src/launchpad-process-pool/launchpad.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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( -- 2.7.4