Skip to content
This repository was archived by the owner on Feb 8, 2021. It is now read-only.

Commit 4156788

Browse files
committed
add NULL check for exec
Signed-off-by: HaoZhang <crazykev@zju.edu.cn>
1 parent 8827c0a commit 4156788

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/exec.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -739,9 +739,12 @@ struct hyper_exec *hyper_find_process(struct hyper_pod *pod, const char *contain
739739
}
740740

741741
struct hyper_exec *exec = hyper_find_exec_by_name(pod, process);
742-
if (strcmp(exec->container_id, container) == 0) {
743-
return exec;
742+
if (exec) {
743+
if (strcmp(exec->container_id, container) == 0) {
744+
return exec;
745+
}
744746
}
747+
745748
return NULL;
746749
}
747750

0 commit comments

Comments
 (0)