From: "Serge E. Hallyn" Subject: [PATCH 6/8] cr: fix memory leak on lsm error on restart Date: Thu, 3 Sep 2009 17:26:49 -0500 Message-ID: <20090903222648.GA27377@us.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: containers-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org Errors-To: containers-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org To: Oren Laadan Cc: Linux Containers List-Id: containers.vger.kernel.org (this is a bugfix for the patch cr: checkpoint the active LSM and add RESTART_KEEP_LSM flag ) Signed-off-by: Serge E. Hallyn --- 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