mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-04-18 03:28:07 -05:00
Make sure out-of-memory errors are logged to malloc.log when we're
logging mallocs. [originally from svn r1564]
This commit is contained in:
parent
b025e37bbb
commit
4f33c36ff5
4
misc.c
4
misc.c
@ -408,6 +408,8 @@ void *safemalloc(size_t size)
|
|||||||
#ifdef MALLOC_LOG
|
#ifdef MALLOC_LOG
|
||||||
sprintf(str, "Out of memory! (%s:%d, size=%d)",
|
sprintf(str, "Out of memory! (%s:%d, size=%d)",
|
||||||
mlog_file, mlog_line, size);
|
mlog_file, mlog_line, size);
|
||||||
|
fprintf(fp, "*** %s\n", str);
|
||||||
|
fclose(fp);
|
||||||
#else
|
#else
|
||||||
strcpy(str, "Out of memory!");
|
strcpy(str, "Out of memory!");
|
||||||
#endif
|
#endif
|
||||||
@ -443,6 +445,8 @@ void *saferealloc(void *ptr, size_t size)
|
|||||||
#ifdef MALLOC_LOG
|
#ifdef MALLOC_LOG
|
||||||
sprintf(str, "Out of memory! (%s:%d, size=%d)",
|
sprintf(str, "Out of memory! (%s:%d, size=%d)",
|
||||||
mlog_file, mlog_line, size);
|
mlog_file, mlog_line, size);
|
||||||
|
fprintf(fp, "*** %s\n", str);
|
||||||
|
fclose(fp);
|
||||||
#else
|
#else
|
||||||
strcpy(str, "Out of memory!");
|
strcpy(str, "Out of memory!");
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user