Skip to content

Commit 7c682e5

Browse files
committed
rimage: fix resource leak in err handling
Fix resource leak in man_module_create_reloc Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com>
1 parent 3793111 commit 7c682e5

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

tools/rimage/src/manifest.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -502,6 +502,7 @@ static int man_module_create_reloc(struct image *image, struct manifest_module *
502502

503503
if (!n_mod || n_mod * sizeof(*sof_mod) != section.header.data.size) {
504504
fprintf(stderr, "error: Invalid module manifests in '.module' section.\n");
505+
elf_section_free(&section);
505506
return -ENOEXEC;
506507
}
507508

@@ -532,6 +533,7 @@ static int man_module_create_reloc(struct image *image, struct manifest_module *
532533

533534
if (j == image->adsp->modules->mod_man_count) {
534535
fprintf(stderr, "error: cannot find %s in manifest.\n", name);
536+
elf_section_free(&section);
535537
return -ENOEXEC;
536538
}
537539
}

0 commit comments

Comments
 (0)