1
0
mirror of https://github.com/moparisthebest/curl synced 2024-12-21 23:58:49 -05:00

memdebug: don't setbuf() if the file open failed

Bug: https://github.com/curl/curl/issues/828#issuecomment-313475151
This commit is contained in:
Gisle Vanem 2017-07-06 23:14:29 +02:00 committed by Daniel Stenberg
parent 2d86e8d128
commit 0cec0f4615

View File

@ -115,7 +115,8 @@ void curl_memdebug(const char *logname)
logfile = stderr;
#ifdef MEMDEBUG_LOG_SYNC
/* Flush the log file after every line so the log isn't lost in a crash */
setbuf(logfile, (char *)NULL);
if(logfile)
setbuf(logfile, (char *)NULL);
#endif
}
}