2020-01-05 22:20:49 -05:00
|
|
|
From 3b253a4a69bc3e239244f7ed0aaab7d8d2bf4187 Mon Sep 17 00:00:00 2001
|
2019-09-30 11:03:07 -04:00
|
|
|
From: liuhao <liuhao27@huawei.com>
|
|
|
|
|
Date: Thu, 11 Apr 2019 20:34:51 +0800
|
2020-01-05 22:20:49 -05:00
|
|
|
Subject: [PATCH 083/138] lxc: free lxc-handler
|
2019-09-30 11:03:07 -04:00
|
|
|
|
|
|
|
|
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
|
2020-01-05 22:20:49 -05:00
|
|
|
index 87e07d3..f1cd7fa 100644
|
2019-09-30 11:03:07 -04:00
|
|
|
--- 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;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
--
|
2020-01-05 22:20:49 -05:00
|
|
|
1.8.3.1
|
2019-09-30 11:03:07 -04:00
|
|
|
|