aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/memdebug.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/memdebug.c b/lib/memdebug.c
index 110169474..582387cf9 100644
--- a/lib/memdebug.c
+++ b/lib/memdebug.c
@@ -73,6 +73,10 @@ void curl_memdebug(const char *logname)
logfile = fopen(logname, "w");
else
logfile = stderr;
+#ifdef MEMDEBUG_LOG_SYNC
+ /* Flush the log file after every line so the log isn't lost in a crash */
+ setvbuf(logfile, (char *)NULL, _IOLBF, 0);
+#endif
}
}