mirror of https://github.com/BOINC/boinc.git
- client: don't fclose() time_stats_log if it's NULL
Fixes #772 svn path=/trunk/boinc/; revision=16478
This commit is contained in:
parent
3fa5b9f844
commit
fd8470af2a
|
@ -9360,3 +9360,12 @@ Charlie 10 Nov 2008 (checked into boinc_core_release_6_3_22 tag)
|
|||
AsyncRPC.cpp
|
||||
DlgExitMessage.cpp
|
||||
DlgOptions.cpp
|
||||
|
||||
David 11 Nov 2008
|
||||
- client: don't fclose() time_stats_log if it's NULL
|
||||
Fixes #772
|
||||
|
||||
client/
|
||||
time_stats.cpp
|
||||
lib/
|
||||
parse.cpp
|
||||
|
|
|
@ -138,7 +138,9 @@ void send_log_after(const char* filename, double t, MIOFILE& mf) {
|
|||
// copy the log file after a given time
|
||||
//
|
||||
void TIME_STATS::get_log_after(double t, MIOFILE& mf) {
|
||||
fclose(time_stats_log); // win: can't open twice
|
||||
if (time_stats_log) {
|
||||
fclose(time_stats_log); // win: can't open twice
|
||||
}
|
||||
send_log_after(TIME_STATS_LOG, t, mf);
|
||||
time_stats_log = fopen(TIME_STATS_LOG, "a");
|
||||
}
|
||||
|
|
|
@ -155,6 +155,9 @@ int dup_element_contents(FILE* in, const char* end_tag, char** pp) {
|
|||
int nused=0; // not counting ending NULL
|
||||
char* buf = (char*)malloc(bufsize);
|
||||
|
||||
// Start with a big buffer.
|
||||
// When done, copy to an exact-size buffer
|
||||
//
|
||||
while (fgets(line, 256, in)) {
|
||||
if (strstr(line, end_tag)) {
|
||||
*pp = (char*)malloc(nused+1);
|
||||
|
|
Loading…
Reference in New Issue