lxc/0083-lxc-free-lxc-handler.patch
LiFeng 7b470b3cde lxc: internal change at 1.6
Change-Id: I5821dc8a44f724e59cee65e356dfae4fbae04f76
Signed-off-by: LiFeng <lifeng68@huawei.com>
2020-01-05 22:20:49 -05:00

42 lines
876 B
Diff

From 3b253a4a69bc3e239244f7ed0aaab7d8d2bf4187 Mon Sep 17 00:00:00 2001
From: liuhao <liuhao27@huawei.com>
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 <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