shithub: choc

Download patch

ref: dc9d3bbafa0f115c81f51d4614c7e9f7fcbe1990
parent: 36fa1d296e0d8d33a8f23ac3d158b44e99860437
author: Fabian Greffrath <fabian@greffrath.com>
date: Mon Aug 21 08:11:16 EDT 2017

Remove two post-realloc checks that are now redundant

--- a/src/midifile.c
+++ b/src/midifile.c
@@ -459,12 +459,6 @@
 
         new_events = I_Realloc(track->events, 
                              sizeof(midi_event_t) * (track->num_events + 1));
-
-        if (new_events == NULL)
-        {
-            return false;
-        }
-
         track->events = new_events;
 
         // Read the next event:
--- a/src/w_wad.c
+++ b/src/w_wad.c
@@ -207,12 +207,6 @@
     startlump = numlumps;
     numlumps += numfilelumps;
     lumpinfo = I_Realloc(lumpinfo, numlumps * sizeof(lumpinfo_t *));
-    if (lumpinfo == NULL)
-    {
-        W_CloseFile(wad_file);
-        I_Error("Failed to increase lumpinfo[] array size.");
-    }
-
     filerover = fileinfo;
 
     for (i = startlump; i < numlumps; ++i)