mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-10 03:45:46 +00:00
Bug 679612 - Add fclose calls to every exit point in APKOpen.cpp to prevent resource leaks; r=mwu
This commit is contained in:
parent
decc044896
commit
6c8e5db9c1
@ -291,6 +291,7 @@ extractFile(const char * path, const struct cdir_entry *entry, void * data)
|
||||
MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
|
||||
if (buf == (void *)-1) {
|
||||
__android_log_print(ANDROID_LOG_ERROR, "GeckoLibLoad", "Couldn't mmap decompression buffer");
|
||||
close(fd);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -510,10 +511,12 @@ static void * mozload(const char * path, void *zip,
|
||||
// we'd like to use fallocate here, but it doesn't exist currently?
|
||||
if (lseek(fd, lib_size - 1, SEEK_SET) == (off_t) - 1) {
|
||||
__android_log_print(ANDROID_LOG_ERROR, "GeckoLibLoad", "seeking file failed");
|
||||
close(fd);
|
||||
return NULL;
|
||||
}
|
||||
if (write(fd, "", 1) != 1) {
|
||||
__android_log_print(ANDROID_LOG_ERROR, "GeckoLibLoad", "writting one byte to the file failed");
|
||||
close(fd);
|
||||
return NULL;
|
||||
}
|
||||
skipLibCache = true;
|
||||
|
Loading…
Reference in New Issue
Block a user