From 5090cb06a00956df4513bd2d5625029d00aa39a0 Mon Sep 17 00:00:00 2001 From: Donghwa Jeong Date: Tue, 19 Jun 2018 10:37:47 +0900 Subject: [PATCH] fix pointer c is dereferenced after checking null Signed-off-by: Donghwa Jeong --- src/tests/get_item.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/tests/get_item.c b/src/tests/get_item.c index e7667c482..a1a6b6705 100644 --- a/src/tests/get_item.c +++ b/src/tests/get_item.c @@ -555,7 +555,10 @@ int main(int argc, char *argv[]) printf("All get_item tests passed\n"); fret = EXIT_SUCCESS; out: - c->destroy(c); - lxc_container_put(c); + if (c) { + c->destroy(c); + lxc_container_put(c); + } + exit(fret); } -- 2.47.2