From: Changgyu Choi Date: Mon, 21 Nov 2022 08:14:52 +0000 (+0900) Subject: Fix static analysis issues X-Git-Tag: accepted/tizen/7.0/unified/20221123.170844~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1be1cd03891460c0b525e35ba1ea19adf9c751bd;p=platform%2Fcore%2Fappfw%2Flaunchpad.git Fix static analysis issues Change-Id: I28acaeb2507b199fcbf1ac56c51120a0468c11b1 Signed-off-by: Changgyu Choi --- diff --git a/src/launchpad-process-pool/src/launchpad.c b/src/launchpad-process-pool/src/launchpad.c index 058d75c..8ba6162 100644 --- a/src/launchpad-process-pool/src/launchpad.c +++ b/src/launchpad-process-pool/src/launchpad.c @@ -968,6 +968,12 @@ static int __prepare_candidate_process(int type, int loader_id) _W("Candidate process. type: %d, loader_id: %d, pid: %d", info->type, info->loader_id, info->pid); cpt = __find_slot(info->type, info->loader_id); + if (cpt == NULL) { + _E("Not found slot."); + __candidate_info_free(info); + return -1; + } + cpt->last_exec_time = time(NULL); if (cpt->is_hydra) { cpt->hydra_pid = info->pid; @@ -2648,10 +2654,11 @@ static bool __handle_launch_event(int fd, io_condition_e cond, void *data) } } - if (request->cmd < 0 || request->cmd > ARRAY_SIZE(__request_handlers) || - __request_handlers[request->cmd] == NULL) { + if (request->cmd < 0 || request->cmd >= ARRAY_SIZE(__request_handlers) + || __request_handlers[request->cmd] == NULL) { _E("Unknown command: %d", request->cmd); __request_send_result(request, -EINVAL); + __request_destroy(request); return true; }