Skip to contentSkip to conversation

cr: fix memory leak on lsm error on restart

PATCH New Serge E. Hallyn 1 participant 1 message Sep 3, 2009

lore
Share & tools
lore
#0 lore raw

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 )

---
 checkpoint/restart.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
checkpoint/restart.c +4 -2
index 67edf39..f51838b 100644
@@ -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