Fix resouce leaks in psp-fixup-imports.c

Fix resouce leaks in psp-fixup-imports.c
This commit is contained in:
ryancaicse
2022-02-07 15:13:51 +08:00
committed by GitHub
parent 0ba656ab48
commit 64d91e402a

View File

@@ -183,6 +183,7 @@ unsigned char *load_file(const char *file, unsigned int *size)
if(*size < sizeof(Elf32_Ehdr))
{
fprintf(stderr, "Error, invalid file size\n");
fclose(fp);
break;
}
@@ -190,6 +191,7 @@ unsigned char *load_file(const char *file, unsigned int *size)
if(data == NULL)
{
fprintf(stderr, "Error, could not allocate memory for ELF\n");
fclose(fp);
break;
}