From 41567880c2b85a8eb0c76c106fadd531ba6a740b Mon Sep 17 00:00:00 2001 From: HaoZhang Date: Sat, 14 Jan 2017 10:19:52 +0800 Subject: [PATCH] add NULL check for exec Signed-off-by: HaoZhang --- src/exec.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/exec.c b/src/exec.c index 17559430..35f2b87b 100644 --- a/src/exec.c +++ b/src/exec.c @@ -739,9 +739,12 @@ struct hyper_exec *hyper_find_process(struct hyper_pod *pod, const char *contain } struct hyper_exec *exec = hyper_find_exec_by_name(pod, process); - if (strcmp(exec->container_id, container) == 0) { - return exec; + if (exec) { + if (strcmp(exec->container_id, container) == 0) { + return exec; + } } + return NULL; }