parent
c3bd8d144c
commit
27227679b4
|
@ -13,6 +13,8 @@ Changes in versino 0.1.2.20 - 2008-??-??
|
|||
Resolves bug 597.
|
||||
- Fix a few memory leaks that could in theory happen under bizarre error
|
||||
conditions.
|
||||
- We were leaking a file descriptor if Tor started with a zero-length
|
||||
cached-descriptors file. Patch by freddy77.
|
||||
|
||||
|
||||
Changes in version 0.1.2.19 - 2008-01-17
|
||||
|
|
|
@ -158,19 +158,18 @@ tor_mmap_file(const char *filename)
|
|||
/* Zero-length file. If we call mmap on it, it will succeed but
|
||||
* return NULL, and bad things will happen. So just fail. */
|
||||
log_info(LD_FS,"File \"%s\" is empty. Ignoring.",filename);
|
||||
close(fd);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
string = mmap(0, size, PROT_READ, MAP_PRIVATE, fd, 0);
|
||||
close(fd);
|
||||
if (string == MAP_FAILED) {
|
||||
close(fd);
|
||||
log_warn(LD_FS,"Could not mmap file \"%s\": %s", filename,
|
||||
strerror(errno));
|
||||
return NULL;
|
||||
}
|
||||
|
||||
close(fd);
|
||||
|
||||
res = tor_malloc_zero(sizeof(tor_mmap_impl_t));
|
||||
res->base.data = string;
|
||||
res->base.size = filesize;
|
||||
|
|
Loading…
Reference in New Issue