Skip to content

Commit

Permalink
rimage: fix resource leak in err handling
Browse files Browse the repository at this point in the history
Fix resource leak in man_module_create_reloc

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com>
  • Loading branch information
abonislawski authored and lgirdwood committed Dec 19, 2024
1 parent dd575a0 commit 72df5f6
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tools/rimage/src/manifest.c
Original file line number Diff line number Diff line change
Expand Up @@ -502,6 +502,7 @@ static int man_module_create_reloc(struct image *image, struct manifest_module *

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

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

if (j == image->adsp->modules->mod_man_count) {
fprintf(stderr, "error: cannot find %s in manifest.\n", name);
elf_section_free(&section);
return -ENOEXEC;
}
}
Expand Down

0 comments on commit 72df5f6

Please sign in to comment.