From 0931d9cc4be979142daf50793d137dedece1e885 Mon Sep 17 00:00:00 2001 From: Adrian Warecki Date: Thu, 16 Feb 2023 16:50:57 +0100 Subject: [PATCH] main: heap_adsp release fix In image re-signing mode or if there are no input files, the memory allocated for heap_adsp was not released. Signed-off-by: Adrian Warecki --- src/rimage.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/rimage.c b/src/rimage.c index 6aa4eabea..4ec34a856 100644 --- a/src/rimage.c +++ b/src/rimage.c @@ -168,7 +168,8 @@ int main(int argc, char *argv[]) if (image.in_file) { fprintf(stdout, "going to re-sign\n"); - return resign_image(&image); + ret = resign_image(&image); + goto out; } /* set IMR Type and the PV bit in found machine definition */ @@ -196,7 +197,8 @@ int main(int argc, char *argv[]) if (image.num_modules <= 0) { fprintf(stderr, "error: requires at least one ELF input module\n"); - return -EINVAL; + ret = -EINVAL; + goto out; } /* getopt reorders argv[] */