diff --git a/src/r_things.cpp b/src/r_things.cpp index 673fdfc6c..76cc91254 100644 --- a/src/r_things.cpp +++ b/src/r_things.cpp @@ -3064,6 +3064,9 @@ void R_DrawMasked(maskcount_t* masks, INT32 nummasks) heads = static_cast(calloc(nummasks, sizeof(drawnode_t))); + if (!heads) + I_Error("R_DrawMasked: No more free memory\n"); + for (i = 0; i < nummasks; i++) { heads[i].next = heads[i].prev = &heads[i];