summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorFrancois Berder <[email protected]>2025-12-18 07:48:51 +0100
committerTom Rini <[email protected]>2026-01-02 15:51:54 -0600
commit5e7624979083e2bc163e18165452d8ead462b58c (patch)
treeb0ba5de052549778472ec11ac876a22ae831e2cd /cmd
parentc55221f1a274886260a7ecdf9da9884bb49f1f38 (diff)
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 <[email protected]>
Diffstat (limited to 'cmd')
-rw-r--r--cmd/onenand.c1
1 files changed, 1 insertions, 0 deletions
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;
}