[Devel] [PATCH 6/8] cr: fix memory leak on lsm error on restart

Serge E. Hallyn serue at us.ibm.com
Thu Sep 3 15:26:49 PDT 2009


(this is a bugfix for the patch
cr: checkpoint the active LSM and add RESTART_KEEP_LSM flag
)

Signed-off-by: Serge E. Hallyn <serue at us.ibm.com>
---
 checkpoint/restart.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/checkpoint/restart.c b/checkpoint/restart.c
index 67edf39..f51838b 100644
--- a/checkpoint/restart.c
+++ b/checkpoint/restart.c
@@ -431,7 +431,8 @@ static int restore_read_header(struct ckpt_ctx *ctx)
 		if (strncmp(cur, ctx->lsm_name, SECURITY_NAME_MAX + 1) != 0) {
 			pr_warning("c/r: checkpointed LSM %s, current is %s.\n",
 				ctx->lsm_name, cur);
-			return -EINVAL;
+			ret = -EINVAL;
+			goto out;
 		}
 		/* to be implemented later, per-lsm */
 		if (strcmp(ctx->lsm_name, "lsm_none") != 0 &&
@@ -440,7 +441,8 @@ static int restore_read_header(struct ckpt_ctx *ctx)
 				strcmp(ctx->lsm_name, "default") != 0) {
 			pr_warning("c/r: RESTART_KEEP_LSM unsupported for %s\n",
 					ctx->lsm_name);
-			return -ENOSYS;
+			ret = -ENOSYS;
+			goto out;
 		}
 	}
 
-- 
1.6.1

_______________________________________________
Containers mailing list
Containers at lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containers




More information about the Devel mailing list