_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;
}
}
- 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;
}