42 lines
876 B
Diff
42 lines
876 B
Diff
From ec26a6a90167cc2a4624a4a5fc68bb9bcb56c651 Mon Sep 17 00:00:00 2001
|
|
From: liuhao <liuhao27@huawei.com>
|
|
Date: Thu, 11 Apr 2019 20:34:51 +0800
|
|
Subject: [PATCH 083/140] lxc: free lxc-handler
|
|
|
|
free handler if failed
|
|
|
|
Signed-off-by: liuhao <liuhao27@huawei.com>
|
|
Signed-off-by: LiFeng <lifeng68@huawei.com>
|
|
---
|
|
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
|
|
|