mirror of
https://github.com/cuberite/libevent.git
synced 2025-09-17 08:17:42 -04:00
Close the file in evutil_read_file whether there's an error or not.
evutil_read_file would close the file if there was an error, but not if things went normally.
This commit is contained in:
parent
c21c663161
commit
0798dd1247
2
evutil.c
2
evutil.c
@ -127,8 +127,8 @@ evutil_read_file(const char *filename, char **content_out, size_t *len_out,
|
|||||||
break;
|
break;
|
||||||
EVUTIL_ASSERT(read_so_far < st.st_size);
|
EVUTIL_ASSERT(read_so_far < st.st_size);
|
||||||
}
|
}
|
||||||
|
close(fd);
|
||||||
if (r < 0) {
|
if (r < 0) {
|
||||||
close(fd);
|
|
||||||
mm_free(mem);
|
mm_free(mem);
|
||||||
return -2;
|
return -2;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user