Free file descriptor if we couldn't find the file

This commit is contained in:
Lukas Spieß
2015-10-21 00:05:31 +02:00
parent 885f4457df
commit a9df11d0be

View File

@@ -794,6 +794,7 @@ static unsigned char kBITPNGEndChunk[4] = {0x49, 0x45, 0x4e, 0x44};
int fd = open([path UTF8String], O_RDONLY, 0);
if (fstat(fd, &fs) < 0) {
// File not found
free(fd);
return;
}