mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-10 13:13:44 +01:00
r7030@Kushana: nickm | 2006-08-04 14:46:52 -0700
Close an fd leak on failed mmap() svn:r6988
This commit is contained in:
parent
7c596c166b
commit
1b7ad5aed3
@ -134,6 +134,7 @@ tor_mmap_file(const char *filename)
|
|||||||
|
|
||||||
string = mmap(0, size, PROT_READ, MAP_PRIVATE, fd, 0);
|
string = mmap(0, size, PROT_READ, MAP_PRIVATE, fd, 0);
|
||||||
if (string == MAP_FAILED) {
|
if (string == MAP_FAILED) {
|
||||||
|
close(fd);
|
||||||
log_warn(LD_FS,"Could not mmap file \"%s\": %s", filename,
|
log_warn(LD_FS,"Could not mmap file \"%s\": %s", filename,
|
||||||
strerror(errno));
|
strerror(errno));
|
||||||
return NULL;
|
return NULL;
|
||||||
|
Loading…
Reference in New Issue
Block a user