cr: fix memory leak on lsm error on restart
PATCH 6/8 cr: fix memory leak on lsm error on restart
(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-r/[email protected]>
--- checkpoint/restart.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-)
checkpoint/restart.c +4 -2
@@ -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; } }
Signature · 1 line
1.6.1