From 3b253a4a69bc3e239244f7ed0aaab7d8d2bf4187 Mon Sep 17 00:00:00 2001 From: liuhao Date: Thu, 11 Apr 2019 20:34:51 +0800 Subject: [PATCH 083/138] lxc: free lxc-handler free handler if failed Signed-off-by: liuhao Signed-off-by: LiFeng --- src/lxc/start.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/lxc/start.c b/src/lxc/start.c index 87e07d3..f1cd7fa 100644 --- a/src/lxc/start.c +++ b/src/lxc/start.c @@ -695,6 +695,10 @@ void lxc_zero_handler(struct lxc_handler *handler) void lxc_free_handler(struct lxc_handler *handler) { + if (handler == NULL) { + return; + } + if (handler->pinfd >= 0) close(handler->pinfd); @@ -2761,8 +2765,8 @@ retry: ret = -1; } - lxc_free_handler(handler); out: + lxc_free_handler(handler); return ret; } -- 1.8.3.1