diff --git a/libs/util/msg.c b/libs/util/msg.c index 13bc20914..1c6a42578 100644 --- a/libs/util/msg.c +++ b/libs/util/msg.c @@ -287,6 +287,8 @@ MSG_ReadString (msg_t *msg) msg->badread_string = malloc (len + 1); msg->badread_string_size = len + 1; } + if (!msg->badread_string) + Sys_Error ("MSG_ReadString: out of memory\n"); strncpy (msg->badread_string, string, len); msg->badread_string[len] = 0; return msg->badread_string;