From: derek@siconix.com Date: Mon, 26 Jan 2009 21:08:17 +0000 (-0700) Subject: env_nand: fix env memory release X-Git-Tag: v2009.03-rc1~109^2~2^2~3 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=5a9427dc9b8438759db3f67a1e547062f76eb18d;p=u-boot env_nand: fix env memory release This fixes a bug that tmp environment memory not being released. Signed-off-by: Derek Ou Signed-off-by: Scott Wood --- diff --git a/common/env_nand.c b/common/env_nand.c index 8af9e74aac..e490775ecf 100644 --- a/common/env_nand.c +++ b/common/env_nand.c @@ -304,9 +304,11 @@ void env_relocate_spec (void) crc1_ok = (crc32(0, tmp_env1->data, ENV_SIZE) == tmp_env1->crc); crc2_ok = (crc32(0, tmp_env2->data, ENV_SIZE) == tmp_env2->crc); - if(!crc1_ok && !crc2_ok) + if(!crc1_ok && !crc2_ok) { + free(tmp_env1); + free(tmp_env2); return use_default(); - else if(crc1_ok && !crc2_ok) + } else if(crc1_ok && !crc2_ok) gd->env_valid = 1; else if(!crc1_ok && crc2_ok) gd->env_valid = 2;