From a58cf9c17a9f93b914fcbcc21a2c6e6bdb753287 Mon Sep 17 00:00:00 2001 From: Mark Olsen Date: Thu, 28 Jul 2005 14:33:18 +0000 Subject: [PATCH] Introducing a new concept to Unix and Windows coders worldwide: Error checking. git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@1170 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/client/pr_menu.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/engine/client/pr_menu.c b/engine/client/pr_menu.c index dcbb0f85b..b99020e27 100644 --- a/engine/client/pr_menu.c +++ b/engine/client/pr_menu.c @@ -1312,14 +1312,17 @@ void VARGS Menu_Abort (char *format, ...) Con_Printf("Menu_Abort: %s\nShutting down menu.dat\n", string); -{ - char *buffer; - int size = 1024*1024*8; - buffer = Z_Malloc(size); - menuprogs->save_ents(menuprogs, buffer, &size, 3); - COM_WriteFile("menucore.txt", buffer, size); - Z_Free(buffer); -} + { + char *buffer; + int size = 1024*1024*8; + buffer = Z_Malloc(size); + if (buffer) + { + menuprogs->save_ents(menuprogs, buffer, &size, 3); + COM_WriteFile("menucore.txt", buffer, size); + Z_Free(buffer); + } + } MP_Shutdown(); }