From: simon Date: Wed, 27 Feb 2002 22:20:03 +0000 (+0000) Subject: Make sure out-of-memory errors are logged to malloc.log when we're X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/commitdiff_plain/1b2ef365edf850456a724b8ea3171734a492da37?hp=7b74af11b01d383a7da040cd22d75b917fadded7 Make sure out-of-memory errors are logged to malloc.log when we're logging mallocs. git-svn-id: svn://svn.tartarus.org/sgt/putty@1564 cda61777-01e9-0310-a592-d414129be87e --- diff --git a/misc.c b/misc.c index cb894b3e..a2d741e5 100644 --- a/misc.c +++ b/misc.c @@ -408,6 +408,8 @@ void *safemalloc(size_t size) #ifdef MALLOC_LOG sprintf(str, "Out of memory! (%s:%d, size=%d)", mlog_file, mlog_line, size); + fprintf(fp, "*** %s\n", str); + fclose(fp); #else strcpy(str, "Out of memory!"); #endif @@ -443,6 +445,8 @@ void *saferealloc(void *ptr, size_t size) #ifdef MALLOC_LOG sprintf(str, "Out of memory! (%s:%d, size=%d)", mlog_file, mlog_line, size); + fprintf(fp, "*** %s\n", str); + fclose(fp); #else strcpy(str, "Out of memory!"); #endif