MessageBox(NULL, "Out of memory!", "PuTTY Fatal Error",
char str[200]; #ifdef MALLOC_LOG sprintf(str, "Out of memory! (%s:%d, size=%d)", mlog_file, mlog_line, size); #else strcpy(str, "Out of memory!"); #endif MessageBox(NULL, str, "PuTTY Fatal Error",
void *saferealloc(void *ptr, size_t size){    void *p;    if (!ptr) {#ifdef MINEFIELD	p = minefield_c_malloc(size);#else	p = malloc(size);#endif    } else {#ifdef MINEFIELD	p = minefield_c_realloc(ptr, size);#else	p = realloc(ptr, size);#endif    }    if (!p) {	MessageBox(NULL, "Out of memory!", "PuTTY Fatal Error",		   MB_SYSTEMMODAL | MB_ICONERROR | MB_OK);	exit(1);    }#ifdef MALLOC_LOG    if (fp)	fprintf(fp, "realloc(%p,%d) returns %p\n", ptr, size, p);#endif    return p;}