From: derek at siconix.com Date: Mon, 26 Jan 2009 10:50:16 -0700 (MST) Subject: [U-Boot] [PATCH 1/1] Bug fix - release env memory. Message-ID: <0bee6c3501ae7b8e2c111bf32219e501.squirrel@webmail.siconix.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de This is my first time to create a patch. Not sure if I have done it right. Signed-off-by: Derek Ou --- common/env_nand.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/common/env_nand.c b/common/env_nand.c index 8af9e74..01430cb 100644 --- a/common/env_nand.c +++ b/common/env_nand.c @@ -305,7 +305,11 @@ void env_relocate_spec (void) crc2_ok = (crc32(0, tmp_env2->data, ENV_SIZE) == tmp_env2->crc); if(!crc1_ok && !crc2_ok) + { + free(tmp_env1); + free(tmp_env2); return use_default(); + } else if(crc1_ok && !crc2_ok) gd->env_valid = 1; else if(!crc1_ok && crc2_ok) -- 1.5.4.3