mirror of
https://github.com/pspdev/pspsdk.git
synced 2025-10-03 16:51:27 +00:00
Fix resource leaks in bin2s.c
Fix resource leaks in bin2s.c
This commit is contained in:
@@ -40,11 +40,13 @@ int main(int argc, char *argv[])
|
|||||||
buffer = malloc(fd_size);
|
buffer = malloc(fd_size);
|
||||||
if(buffer == NULL) {
|
if(buffer == NULL) {
|
||||||
printf("Failed to allocate memory.\n");
|
printf("Failed to allocate memory.\n");
|
||||||
|
fclose(source);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(fread(buffer,1,fd_size,source) != fd_size) {
|
if(fread(buffer,1,fd_size,source) != fd_size) {
|
||||||
printf("Failed to read file.\n");
|
printf("Failed to read file.\n");
|
||||||
|
fclose(source);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
fclose(source);
|
fclose(source);
|
||||||
|
Reference in New Issue
Block a user