Merge remote-tracking branch 'public/bug7816_023'

Conflicts:
	src/common/util.c
This commit is contained in:
Nick Mathewson
2013-02-07 15:20:50 -05:00
7 changed files with 26 additions and 3 deletions
+3 -1
View File
@@ -833,8 +833,10 @@ add_file_log(const log_severity_list_t *severity, const char *filename)
fd = tor_open_cloexec(filename, O_WRONLY|O_CREAT|O_APPEND, 0644);
if (fd<0)
return -1;
if (tor_fd_seekend(fd)<0)
if (tor_fd_seekend(fd)<0) {
close(fd);
return -1;
}
LOCK_LOGS();
add_stream_log_impl(severity, filename, fd);
+3 -1
View File
@@ -2374,8 +2374,10 @@ read_file_to_str(const char *filename, int flags, struct stat *stat_out)
}
#endif
if ((uint64_t)(statbuf.st_size)+1 >= SIZE_T_CEILING)
if ((uint64_t)(statbuf.st_size)+1 >= SIZE_T_CEILING) {
close(fd);
return NULL;
}
string = tor_malloc((size_t)(statbuf.st_size+1));