From a48dcdf22472bf0c1206aefc3e01b6e22a49f3e6 Mon Sep 17 00:00:00 2001 From: Zack Middleton Date: Sat, 9 Sep 2017 17:11:26 -0500 Subject: [PATCH] Fix crash when out of memory in Team Arena's String_Alloc --- code/ui/ui_shared.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/code/ui/ui_shared.c b/code/ui/ui_shared.c index f26d11b8..e574f78d 100644 --- a/code/ui/ui_shared.c +++ b/code/ui/ui_shared.c @@ -198,6 +198,9 @@ const char *String_Alloc(const char *p) { } str = UI_Alloc(sizeof(stringDef_t)); + if (!str) { + return NULL; + } str->next = NULL; str->str = &strPool[ph]; if (last) {