[gamecode] Check resmap return before memset

New gcc (11) Caught another issue (only one this time, which is nice).
This commit is contained in:
Bill Currie 2021-11-19 11:55:32 +09:00
parent 48ecfcf411
commit aa7fe66d9d
1 changed files with 3 additions and 1 deletions

View File

@ -1585,7 +1585,9 @@ void *PR_Resources_Find (progs_t *pr, const char *name);
#define PR_RESNEW(map) \
({ \
__auto_type t = PR_RESNEW_NC (map); \
memset (t, 0, sizeof (*(map)._free)); \
if (t) { \
memset (t, 0, sizeof (*(map)._free)); \
} \
t; \
})