Skip to content

Commit d1b488f

Browse files
committed
Guard elf-parser fclose on open failure
F/1101
1 parent 20c3b86 commit d1b488f

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

tools/elf-parser/elf-parser.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,9 @@ int main(int argc, char *argv[])
6767
ret = -1;
6868
}
6969
}
70-
fclose(f);
70+
if (f != NULL) {
71+
fclose(f);
72+
}
7173

7274
if (ret == 0) {
7375
ret = elf_load_image_mmu(image, (uint32_t)imageSz, &entry, NULL);

0 commit comments

Comments
 (0)