From: Francois Berder Date: Thu, 18 Dec 2025 06:48:51 +0000 (+0100) Subject: cmd: onenand: Fix handling error path in onenand_block_test X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5e7624979083e2bc163e18165452d8ead462b58c;p=thirdparty%2Fu-boot.git cmd: onenand: Fix handling error path in onenand_block_test If memory allocation for verify_buf fails, then one needs to make sure that memory allocated for buf is released. Signed-off-by: Francois Berder --- diff --git a/cmd/onenand.c b/cmd/onenand.c index 6e808ce3fce..90f4f52f4af 100644 --- a/cmd/onenand.c +++ b/cmd/onenand.c @@ -236,6 +236,7 @@ static int onenand_block_test(u32 start, u32 size) verify_buf = malloc(blocksize); if (!verify_buf) { + free(buf); printf("Not enough malloc space available!\n"); return -1; }