Fixed a resource leak in the hard disk image code.

This commit is contained in:
OBattler
2020-01-14 23:08:13 +01:00
parent 93695b15b3
commit 84659f6b01

View File

@@ -128,8 +128,11 @@ image_is_hdx(const wchar_t *s, int check_signature)
fseeko64(f, 0, SEEK_END);
filelen = ftello64(f);
fseeko64(f, 0, SEEK_SET);
if (filelen < 44)
if (filelen < 44) {
if (f != NULL)
fclose(f);
return 0;
}
fread(&signature, 1, 8, f);
fclose(f);
if (signature == 0xD778A82044445459ll)