Christoph Mallon: Remove pointless if (x) before SDL_free(x)
authorSam Lantinga <slouken@libsdl.org>
Thu, 29 Aug 2013 08:29:21 -0700
changeset 7719 31b5f9ff36ca
parent 7718 213b9777e988
child 7720 f9a649383362
Christoph Mallon: Remove pointless if (x) before SDL_free(x)
src/SDL_hints.c
src/audio/SDL_audio.c
src/audio/SDL_wave.c
src/audio/alsa/SDL_alsa_audio.c
src/audio/arts/SDL_artsaudio.c
src/audio/bsd/SDL_bsdaudio.c
src/audio/disk/SDL_diskaudio.c
src/audio/dsp/SDL_dspaudio.c
src/audio/esd/SDL_esdaudio.c
src/audio/fusionsound/SDL_fsaudio.c
src/audio/nas/SDL_nasaudio.c
src/audio/paudio/SDL_paudio.c
src/audio/pulseaudio/SDL_pulseaudio.c
src/audio/qsa/SDL_qsa_audio.c
src/audio/sndio/SDL_sndioaudio.c
src/audio/sun/SDL_sunaudio.c
src/audio/winmm/SDL_winmm.c
src/audio/xaudio2/SDL_xaudio2.c
src/events/SDL_events.c
src/events/SDL_touch.c
src/file/SDL_rwops.c
src/filesystem/unix/SDL_sysfilesystem.c
src/haptic/SDL_haptic.c
src/haptic/darwin/SDL_syshaptic.c
src/haptic/windows/SDL_syshaptic.c
src/joystick/SDL_joystick.c
src/joystick/beos/SDL_bejoystick.cc
src/joystick/bsd/SDL_sysjoystick.c
src/joystick/windows/SDL_dxjoystick.c
src/joystick/windows/SDL_mmjoystick.c
src/render/SDL_render.c
src/render/SDL_yuv_sw.c
src/render/direct3d/SDL_render_d3d.c
src/render/opengl/SDL_render_gl.c
src/render/opengles/SDL_render_gles.c
src/render/opengles2/SDL_render_gles2.c
src/render/psp/SDL_render_psp.c
src/render/software/SDL_render_sw.c
src/stdlib/SDL_iconv.c
src/test/SDL_test_common.c
src/video/SDL_RLEaccel.c
src/video/SDL_clipboard.c
src/video/SDL_pixels.c
src/video/SDL_surface.c
src/video/SDL_video.c
src/video/cocoa/SDL_cocoamodes.m
src/video/cocoa/SDL_cocoavideo.m
src/video/directfb/SDL_DirectFB_render.c
src/video/directfb/SDL_DirectFB_video.h
src/video/dummy/SDL_nullvideo.c
src/video/uikit/SDL_uikitvideo.m
src/video/windows/SDL_windowsmessagebox.c
src/video/windows/SDL_windowsvideo.c
src/video/windows/SDL_windowswindow.c
src/video/x11/SDL_x11opengl.c
src/video/x11/SDL_x11video.c
test/testautomation.c
test/testautomation_audio.c
test/testautomation_clipboard.c
test/testautomation_render.c
test/testautomation_video.c
test/testiconv.c
test/testsprite2.c
--- a/src/SDL_hints.c	Thu Aug 29 08:27:25 2013 -0700
+++ b/src/SDL_hints.c	Thu Aug 29 08:29:21 2013 -0700
@@ -72,9 +72,7 @@
                     entry->callback(entry->userdata, name, hint->value, value);
                     entry = next;
                 }
-                if (hint->value) {
-                    SDL_free(hint->value);
-                }
+                SDL_free(hint->value);
                 hint->value = value ? SDL_strdup(value) : NULL;
             }
             hint->priority = priority;
@@ -206,9 +204,7 @@
         SDL_hints = hint->next;
 
         SDL_free(hint->name);
-        if (hint->value) {
-            SDL_free(hint->value);
-        }
+        SDL_free(hint->value);
         for (entry = hint->callbacks; entry; ) {
             SDL_HintWatch *freeable = entry;
             entry = entry->next;
--- a/src/audio/SDL_audio.c	Thu Aug 29 08:27:25 2013 -0700
+++ b/src/audio/SDL_audio.c	Thu Aug 29 08:29:21 2013 -0700
@@ -300,9 +300,7 @@
 static void
 SDL_StreamDeinit(SDL_AudioStreamer * stream)
 {
-    if (stream->buffer != NULL) {
-        SDL_free(stream->buffer);
-    }
+    SDL_free(stream->buffer);
 }
 
 #if defined(ANDROID)
@@ -632,9 +630,7 @@
         }
     }
 
-    if (*devices != NULL) {
-        SDL_free(*devices);
-    }
+    SDL_free(*devices);
 
     *devices = NULL;
     *devCount = 0;
@@ -761,9 +757,7 @@
     if (device->mixer_lock != NULL) {
         SDL_DestroyMutex(device->mixer_lock);
     }
-    if (device->fake_stream != NULL) {
-        SDL_FreeAudioMem(device->fake_stream);
-    }
+    SDL_FreeAudioMem(device->fake_stream);
     if (device->convert.needed) {
         SDL_FreeAudioMem(device->convert.buf);
     }
--- a/src/audio/SDL_wave.c	Thu Aug 29 08:27:25 2013 -0700
+++ b/src/audio/SDL_wave.c	Thu Aug 29 08:29:21 2013 -0700
@@ -449,10 +449,8 @@
     /* Read the audio data format chunk */
     chunk.data = NULL;
     do {
-        if (chunk.data != NULL) {
-            SDL_free(chunk.data);
-            chunk.data = NULL;
-        }
+        SDL_free(chunk.data);
+        chunk.data = NULL;
         lenread = ReadChunk(src, &chunk);
         if (lenread < 0) {
             was_error = 1;
@@ -549,10 +547,8 @@
     /* Read the audio data chunk */
     *audio_buf = NULL;
     do {
-        if (*audio_buf != NULL) {
-            SDL_free(*audio_buf);
-            *audio_buf = NULL;
-        }
+        SDL_free(*audio_buf);
+        *audio_buf = NULL;
         lenread = ReadChunk(src, &chunk);
         if (lenread < 0) {
             was_error = 1;
@@ -583,9 +579,7 @@
     *audio_len &= ~(samplesize - 1);
 
   done:
-    if (format != NULL) {
-        SDL_free(format);
-    }
+    SDL_free(format);
     if (src) {
         if (freesrc) {
             SDL_RWclose(src);
@@ -606,9 +600,7 @@
 void
 SDL_FreeWAV(Uint8 * audio_buf)
 {
-    if (audio_buf != NULL) {
-        SDL_free(audio_buf);
-    }
+    SDL_free(audio_buf);
 }
 
 static int
--- a/src/audio/alsa/SDL_alsa_audio.c	Thu Aug 29 08:27:25 2013 -0700
+++ b/src/audio/alsa/SDL_alsa_audio.c	Thu Aug 29 08:29:21 2013 -0700
@@ -340,10 +340,8 @@
 ALSA_CloseDevice(_THIS)
 {
     if (this->hidden != NULL) {
-        if (this->hidden->mixbuf != NULL) {
-            SDL_FreeAudioMem(this->hidden->mixbuf);
-            this->hidden->mixbuf = NULL;
-        }
+        SDL_FreeAudioMem(this->hidden->mixbuf);
+        this->hidden->mixbuf = NULL;
         if (this->hidden->pcm_handle) {
             ALSA_snd_pcm_drain(this->hidden->pcm_handle);
             ALSA_snd_pcm_close(this->hidden->pcm_handle);
--- a/src/audio/arts/SDL_artsaudio.c	Thu Aug 29 08:27:25 2013 -0700
+++ b/src/audio/arts/SDL_artsaudio.c	Thu Aug 29 08:29:21 2013 -0700
@@ -204,10 +204,8 @@
 ARTS_CloseDevice(_THIS)
 {
     if (this->hidden != NULL) {
-        if (this->hidden->mixbuf != NULL) {
-            SDL_FreeAudioMem(this->hidden->mixbuf);
-            this->hidden->mixbuf = NULL;
-        }
+        SDL_FreeAudioMem(this->hidden->mixbuf);
+        this->hidden->mixbuf = NULL;
         if (this->hidden->stream) {
             SDL_NAME(arts_close_stream) (this->hidden->stream);
             this->hidden->stream = 0;
--- a/src/audio/bsd/SDL_bsdaudio.c	Thu Aug 29 08:27:25 2013 -0700
+++ b/src/audio/bsd/SDL_bsdaudio.c	Thu Aug 29 08:29:21 2013 -0700
@@ -214,10 +214,8 @@
 BSDAUDIO_CloseDevice(_THIS)
 {
     if (this->hidden != NULL) {
-        if (this->hidden->mixbuf != NULL) {
-            SDL_FreeAudioMem(this->hidden->mixbuf);
-            this->hidden->mixbuf = NULL;
-        }
+        SDL_FreeAudioMem(this->hidden->mixbuf);
+        this->hidden->mixbuf = NULL;
         if (this->hidden->audio_fd >= 0) {
             close(this->hidden->audio_fd);
             this->hidden->audio_fd = -1;
--- a/src/audio/disk/SDL_diskaudio.c	Thu Aug 29 08:27:25 2013 -0700
+++ b/src/audio/disk/SDL_diskaudio.c	Thu Aug 29 08:29:21 2013 -0700
@@ -88,10 +88,8 @@
 DISKAUD_CloseDevice(_THIS)
 {
     if (this->hidden != NULL) {
-        if (this->hidden->mixbuf != NULL) {
-            SDL_FreeAudioMem(this->hidden->mixbuf);
-            this->hidden->mixbuf = NULL;
-        }
+        SDL_FreeAudioMem(this->hidden->mixbuf);
+        this->hidden->mixbuf = NULL;
         if (this->hidden->output != NULL) {
             SDL_RWclose(this->hidden->output);
             this->hidden->output = NULL;
--- a/src/audio/dsp/SDL_dspaudio.c	Thu Aug 29 08:27:25 2013 -0700
+++ b/src/audio/dsp/SDL_dspaudio.c	Thu Aug 29 08:29:21 2013 -0700
@@ -61,10 +61,8 @@
 DSP_CloseDevice(_THIS)
 {
     if (this->hidden != NULL) {
-        if (this->hidden->mixbuf != NULL) {
-            SDL_FreeAudioMem(this->hidden->mixbuf);
-            this->hidden->mixbuf = NULL;
-        }
+        SDL_FreeAudioMem(this->hidden->mixbuf);
+        this->hidden->mixbuf = NULL;
         if (this->hidden->audio_fd >= 0) {
             close(this->hidden->audio_fd);
             this->hidden->audio_fd = -1;
--- a/src/audio/esd/SDL_esdaudio.c	Thu Aug 29 08:27:25 2013 -0700
+++ b/src/audio/esd/SDL_esdaudio.c	Thu Aug 29 08:29:21 2013 -0700
@@ -176,10 +176,8 @@
 ESD_CloseDevice(_THIS)
 {
     if (this->hidden != NULL) {
-        if (this->hidden->mixbuf != NULL) {
-            SDL_FreeAudioMem(this->hidden->mixbuf);
-            this->hidden->mixbuf = NULL;
-        }
+        SDL_FreeAudioMem(this->hidden->mixbuf);
+        this->hidden->mixbuf = NULL;
         if (this->hidden->audio_fd >= 0) {
             SDL_NAME(esd_close) (this->hidden->audio_fd);
             this->hidden->audio_fd = -1;
--- a/src/audio/fusionsound/SDL_fsaudio.c	Thu Aug 29 08:27:25 2013 -0700
+++ b/src/audio/fusionsound/SDL_fsaudio.c	Thu Aug 29 08:29:21 2013 -0700
@@ -169,10 +169,8 @@
 SDL_FS_CloseDevice(_THIS)
 {
     if (this->hidden != NULL) {
-        if (this->hidden->mixbuf != NULL) {
-            SDL_FreeAudioMem(this->hidden->mixbuf);
-            this->hidden->mixbuf = NULL;
-        }
+        SDL_FreeAudioMem(this->hidden->mixbuf);
+        this->hidden->mixbuf = NULL;
         if (this->hidden->stream) {
             this->hidden->stream->Release(this->hidden->stream);
             this->hidden->stream = NULL;
--- a/src/audio/nas/SDL_nasaudio.c	Thu Aug 29 08:27:25 2013 -0700
+++ b/src/audio/nas/SDL_nasaudio.c	Thu Aug 29 08:29:21 2013 -0700
@@ -191,10 +191,8 @@
 NAS_CloseDevice(_THIS)
 {
     if (this->hidden != NULL) {
-        if (this->hidden->mixbuf != NULL) {
-            SDL_FreeAudioMem(this->hidden->mixbuf);
-            this->hidden->mixbuf = NULL;
-        }
+        SDL_FreeAudioMem(this->hidden->mixbuf);
+        this->hidden->mixbuf = NULL;
         if (this->hidden->aud) {
             NAS_AuCloseServer(this->hidden->aud);
             this->hidden->aud = 0;
--- a/src/audio/paudio/SDL_paudio.c	Thu Aug 29 08:27:25 2013 -0700
+++ b/src/audio/paudio/SDL_paudio.c	Thu Aug 29 08:29:21 2013 -0700
@@ -231,10 +231,8 @@
 PAUDIO_CloseDevice(_THIS)
 {
     if (this->hidden != NULL) {
-        if (this->hidden->mixbuf != NULL) {
-            SDL_FreeAudioMem(this->hidden->mixbuf);
-            this->hidden->mixbuf = NULL;
-        }
+        SDL_FreeAudioMem(this->hidden->mixbuf);
+        this->hidden->mixbuf = NULL;
         if (this->hidden->audio_fd >= 0) {
             close(this->hidden->audio_fd);
             this->hidden->audio_fd = -1;
--- a/src/audio/pulseaudio/SDL_pulseaudio.c	Thu Aug 29 08:27:25 2013 -0700
+++ b/src/audio/pulseaudio/SDL_pulseaudio.c	Thu Aug 29 08:29:21 2013 -0700
@@ -300,10 +300,8 @@
 PULSEAUDIO_CloseDevice(_THIS)
 {
     if (this->hidden != NULL) {
-        if (this->hidden->mixbuf != NULL) {
-            SDL_FreeAudioMem(this->hidden->mixbuf);
-            this->hidden->mixbuf = NULL;
-        }
+        SDL_FreeAudioMem(this->hidden->mixbuf);
+        this->hidden->mixbuf = NULL;
         if (this->hidden->stream) {
             PULSEAUDIO_pa_stream_disconnect(this->hidden->stream);
             PULSEAUDIO_pa_stream_unref(this->hidden->stream);
--- a/src/audio/qsa/SDL_qsa_audio.c	Thu Aug 29 08:27:25 2013 -0700
+++ b/src/audio/qsa/SDL_qsa_audio.c	Thu Aug 29 08:29:21 2013 -0700
@@ -328,10 +328,8 @@
             this->hidden->audio_handle = NULL;
         }
 
-        if (this->hidden->pcm_buf != NULL) {
-            SDL_FreeAudioMem(this->hidden->pcm_buf);
-            this->hidden->pcm_buf = NULL;
-        }
+        SDL_FreeAudioMem(this->hidden->pcm_buf);
+        this->hidden->pcm_buf = NULL;
 
         SDL_free(this->hidden);
         this->hidden = NULL;
--- a/src/audio/sndio/SDL_sndioaudio.c	Thu Aug 29 08:27:25 2013 -0700
+++ b/src/audio/sndio/SDL_sndioaudio.c	Thu Aug 29 08:29:21 2013 -0700
@@ -181,10 +181,8 @@
 SNDIO_CloseDevice(_THIS)
 {
     if (this->hidden != NULL) {
-        if (this->hidden->mixbuf != NULL) {
-            SDL_FreeAudioMem(this->hidden->mixbuf);
-            this->hidden->mixbuf = NULL;
-        }
+        SDL_FreeAudioMem(this->hidden->mixbuf);
+        this->hidden->mixbuf = NULL;
         if ( this->hidden->dev != NULL ) {
             SNDIO_sio_close(this->hidden->dev);
             this->hidden->dev = NULL;
--- a/src/audio/sun/SDL_sunaudio.c	Thu Aug 29 08:27:25 2013 -0700
+++ b/src/audio/sun/SDL_sunaudio.c	Thu Aug 29 08:29:21 2013 -0700
@@ -184,14 +184,10 @@
 SUNAUDIO_CloseDevice(_THIS)
 {
     if (this->hidden != NULL) {
-        if (this->hidden->mixbuf != NULL) {
-            SDL_FreeAudioMem(this->hidden->mixbuf);
-            this->hidden->mixbuf = NULL;
-        }
-        if (this->hidden->ulaw_buf != NULL) {
-            SDL_free(this->hidden->ulaw_buf);
-            this->hidden->ulaw_buf = NULL;
-        }
+        SDL_FreeAudioMem(this->hidden->mixbuf);
+        this->hidden->mixbuf = NULL;
+        SDL_free(this->hidden->ulaw_buf);
+        this->hidden->ulaw_buf = NULL;
         if (this->hidden->audio_fd >= 0) {
             close(this->hidden->audio_fd);
             this->hidden->audio_fd = -1;
--- a/src/audio/winmm/SDL_winmm.c	Thu Aug 29 08:27:25 2013 -0700
+++ b/src/audio/winmm/SDL_winmm.c	Thu Aug 29 08:29:21 2013 -0700
@@ -176,11 +176,9 @@
             }
         }
 
-        if (this->hidden->mixbuf != NULL) {
-            /* Free raw mixing buffer */
-            SDL_free(this->hidden->mixbuf);
-            this->hidden->mixbuf = NULL;
-        }
+        /* Free raw mixing buffer */
+        SDL_free(this->hidden->mixbuf);
+        this->hidden->mixbuf = NULL;
 
         if (this->hidden->hin) {
             waveInClose(this->hidden->hin);
--- a/src/audio/xaudio2/SDL_xaudio2.c	Thu Aug 29 08:27:25 2013 -0700
+++ b/src/audio/xaudio2/SDL_xaudio2.c	Thu Aug 29 08:29:21 2013 -0700
@@ -205,9 +205,7 @@
         if (ixa2 != NULL) {
             IXAudio2_Release(ixa2);
         }
-        if (this->hidden->mixbuf != NULL) {
-            SDL_free(this->hidden->mixbuf);
-        }
+        SDL_free(this->hidden->mixbuf);
         if (this->hidden->semaphore != NULL) {
             CloseHandle(this->hidden->semaphore);
         }
--- a/src/events/SDL_events.c	Thu Aug 29 08:27:25 2013 -0700
+++ b/src/events/SDL_events.c	Thu Aug 29 08:29:21 2013 -0700
@@ -141,10 +141,8 @@
 
     /* Clear disabled event state */
     for (i = 0; i < SDL_arraysize(SDL_disabled_events); ++i) {
-        if (SDL_disabled_events[i]) {
-            SDL_free(SDL_disabled_events[i]);
-            SDL_disabled_events[i] = NULL;
-        }
+        SDL_free(SDL_disabled_events[i]);
+        SDL_disabled_events[i] = NULL;
     }
 
     while (SDL_event_watchers) {
--- a/src/events/SDL_touch.c	Thu Aug 29 08:27:25 2013 -0700
+++ b/src/events/SDL_touch.c	Thu Aug 29 08:29:21 2013 -0700
@@ -355,10 +355,8 @@
     }
     SDL_assert(SDL_num_touch == 0);
 
-    if (SDL_touchDevices) {
-        SDL_free(SDL_touchDevices);
-        SDL_touchDevices = NULL;
-    }
+    SDL_free(SDL_touchDevices);
+    SDL_touchDevices = NULL;
 }
 
 /* vi: set ts=4 sw=4 expandtab: */
--- a/src/file/SDL_rwops.c	Thu Aug 29 08:27:25 2013 -0700
+++ b/src/file/SDL_rwops.c	Thu Aug 29 08:29:21 2013 -0700
@@ -275,10 +275,8 @@
             CloseHandle(context->hidden.windowsio.h);
             context->hidden.windowsio.h = INVALID_HANDLE_VALUE;   /* to be sure */
         }
-        if (context->hidden.windowsio.buffer.data) {
-            SDL_free(context->hidden.windowsio.buffer.data);
-            context->hidden.windowsio.buffer.data = NULL;
-        }
+        SDL_free(context->hidden.windowsio.buffer.data);
+        context->hidden.windowsio.buffer.data = NULL;
         SDL_FreeRW(context);
     }
     return (0);
--- a/src/filesystem/unix/SDL_sysfilesystem.c	Thu Aug 29 08:27:25 2013 -0700
+++ b/src/filesystem/unix/SDL_sysfilesystem.c	Thu Aug 29 08:29:21 2013 -0700
@@ -69,9 +69,7 @@
         len *= 2;  /* grow buffer, try again. */
     }
 
-    if (retval != NULL) {
-        SDL_free(retval);
-    }
+    SDL_free(retval);
     return NULL;
 }
 
--- a/src/haptic/SDL_haptic.c	Thu Aug 29 08:27:25 2013 -0700
+++ b/src/haptic/SDL_haptic.c	Thu Aug 29 08:29:21 2013 -0700
@@ -379,10 +379,8 @@
 SDL_HapticQuit(void)
 {
     SDL_SYS_HapticQuit();
-    if (SDL_haptics != NULL) {
-        SDL_free(SDL_haptics);
-        SDL_haptics = NULL;
-    }
+    SDL_free(SDL_haptics);
+    SDL_haptics = NULL;
     SDL_numhaptics = 0;
 }
 
--- a/src/haptic/darwin/SDL_syshaptic.c	Thu Aug 29 08:27:25 2013 -0700
+++ b/src/haptic/darwin/SDL_syshaptic.c	Thu Aug 29 08:29:21 2013 -0700
@@ -943,14 +943,10 @@
 {
     FFCUSTOMFORCE *custom;
 
-    if (effect->lpEnvelope != NULL) {
-        SDL_free(effect->lpEnvelope);
-        effect->lpEnvelope = NULL;
-    }
-    if (effect->rgdwAxes != NULL) {
-        SDL_free(effect->rgdwAxes);
-        effect->rgdwAxes = NULL;
-    }
+    SDL_free(effect->lpEnvelope);
+    effect->lpEnvelope = NULL;
+    SDL_free(effect->rgdwAxes);
+    effect->rgdwAxes = NULL;
     if (effect->lpvTypeSpecificParams != NULL) {
         if (type == SDL_HAPTIC_CUSTOM) {        /* Must free the custom data. */
             custom = (FFCUSTOMFORCE *) effect->lpvTypeSpecificParams;
@@ -960,10 +956,8 @@
         SDL_free(effect->lpvTypeSpecificParams);
         effect->lpvTypeSpecificParams = NULL;
     }
-    if (effect->rglDirection != NULL) {
-        SDL_free(effect->rglDirection);
-        effect->rglDirection = NULL;
-    }
+    SDL_free(effect->rglDirection);
+    effect->rglDirection = NULL;
 }
 
 
@@ -1061,10 +1055,8 @@
   err_effectdone:
     SDL_SYS_HapticFreeFFEFFECT(&effect->hweffect->effect, base->type);
   err_hweffect:
-    if (effect->hweffect != NULL) {
-        SDL_free(effect->hweffect);
-        effect->hweffect = NULL;
-    }
+    SDL_free(effect->hweffect);
+    effect->hweffect = NULL;
     return -1;
 }
 
--- a/src/haptic/windows/SDL_syshaptic.c	Thu Aug 29 08:27:25 2013 -0700
+++ b/src/haptic/windows/SDL_syshaptic.c	Thu Aug 29 08:29:21 2013 -0700
@@ -751,10 +751,8 @@
     }
 
     for (i = 0; i < SDL_arraysize(SDL_hapticlist); ++i) {
-        if (SDL_hapticlist[i].name) {
-            SDL_free(SDL_hapticlist[i].name);
-            SDL_hapticlist[i].name = NULL;
-        }
+        SDL_free(SDL_hapticlist[i].name);
+        SDL_hapticlist[i].name = NULL;
     }
 
     if (dinput != NULL) {
@@ -1127,14 +1125,10 @@
 {
     DICUSTOMFORCE *custom;
 
-    if (effect->lpEnvelope != NULL) {
-        SDL_free(effect->lpEnvelope);
-        effect->lpEnvelope = NULL;
-    }
-    if (effect->rgdwAxes != NULL) {
-        SDL_free(effect->rgdwAxes);
-        effect->rgdwAxes = NULL;
-    }
+    SDL_free(effect->lpEnvelope);
+    effect->lpEnvelope = NULL;
+    SDL_free(effect->rgdwAxes);
+    effect->rgdwAxes = NULL;
     if (effect->lpvTypeSpecificParams != NULL) {
         if (type == SDL_HAPTIC_CUSTOM) {        /* Must free the custom data. */
             custom = (DICUSTOMFORCE *) effect->lpvTypeSpecificParams;
@@ -1144,10 +1138,8 @@
         SDL_free(effect->lpvTypeSpecificParams);
         effect->lpvTypeSpecificParams = NULL;
     }
-    if (effect->rglDirection != NULL) {
-        SDL_free(effect->rglDirection);
-        effect->rglDirection = NULL;
-    }
+    SDL_free(effect->rglDirection);
+    effect->rglDirection = NULL;
 }
 
 
@@ -1250,10 +1242,8 @@
   err_effectdone:
     SDL_SYS_HapticFreeDIEFFECT(&effect->hweffect->effect, base->type);
   err_hweffect:
-    if (effect->hweffect != NULL) {
-        SDL_free(effect->hweffect);
-        effect->hweffect = NULL;
-    }
+    SDL_free(effect->hweffect);
+    effect->hweffect = NULL;
     return -1;
 }
 
--- a/src/joystick/SDL_joystick.c	Thu Aug 29 08:27:25 2013 -0700
+++ b/src/joystick/SDL_joystick.c	Thu Aug 29 08:29:21 2013 -0700
@@ -437,22 +437,13 @@
         joysticklist = joysticklist->next;
     }
 
-    if (joystick->name)
-        SDL_free(joystick->name);
+    SDL_free(joystick->name);
 
     /* Free the data associated with this joystick */
-    if (joystick->axes) {
-        SDL_free(joystick->axes);
-    }
-    if (joystick->hats) {
-        SDL_free(joystick->hats);
-    }
-    if (joystick->balls) {
-        SDL_free(joystick->balls);
-    }
-    if (joystick->buttons) {
-        SDL_free(joystick->buttons);
-    }
+    SDL_free(joystick->axes);
+    SDL_free(joystick->hats);
+    SDL_free(joystick->balls);
+    SDL_free(joystick->buttons);
     SDL_free(joystick);
 }
 
--- a/src/joystick/beos/SDL_bejoystick.cc	Thu Aug 29 08:27:25 2013 -0700
+++ b/src/joystick/beos/SDL_bejoystick.cc	Thu Aug 29 08:29:21 2013 -0700
@@ -231,12 +231,8 @@
         if (joystick->hwdata) {
             joystick->hwdata->stick->Close();
             delete joystick->hwdata->stick;
-            if (joystick->hwdata->new_hats) {
-                SDL_free(joystick->hwdata->new_hats);
-            }
-            if (joystick->hwdata->new_axes) {
-                SDL_free(joystick->hwdata->new_axes);
-            }
+            SDL_free(joystick->hwdata->new_hats);
+            SDL_free(joystick->hwdata->new_axes);
             SDL_free(joystick->hwdata);
             joystick->hwdata = NULL;
         }
--- a/src/joystick/bsd/SDL_sysjoystick.c	Thu Aug 29 08:27:25 2013 -0700
+++ b/src/joystick/bsd/SDL_sysjoystick.c	Thu Aug 29 08:29:21 2013 -0700
@@ -577,10 +577,8 @@
     int i;
 
     for (i = 0; i < MAX_JOYS; i++) {
-        if (joynames[i] != NULL)
-            SDL_free(joynames[i]);
-        if (joydevnames[i] != NULL)
-            SDL_free(joydevnames[i]);
+        SDL_free(joynames[i]);
+        SDL_free(joydevnames[i]);
     }
 
     return;
@@ -657,9 +655,7 @@
 static void
 report_free(struct report *r)
 {
-    if (r->buf != NULL) {
-        SDL_free(r->buf);
-    }
+    SDL_free(r->buf);
     r->status = SREPORT_UNINIT;
 }
 
--- a/src/joystick/windows/SDL_dxjoystick.c	Thu Aug 29 08:27:25 2013 -0700
+++ b/src/joystick/windows/SDL_dxjoystick.c	Thu Aug 29 08:29:21 2013 -0700
@@ -834,7 +834,7 @@
 
             pListNext = pCurList->pNext;
             SDL_free(pCurList->joystickname);
-            SDL_free( pCurList );
+            SDL_free(pCurList);
             pCurList = pListNext;
         }
 
@@ -1559,10 +1559,8 @@
         IDirectInputDevice8_Release(joystick->hwdata->InputDevice);
     }
 
-    if (joystick->hwdata != NULL) {
-        /* free system specific hardware data */
-        SDL_free(joystick->hwdata);
-    }
+    /* free system specific hardware data */
+    SDL_free(joystick->hwdata);
 
     joystick->closed = 1;
 }
--- a/src/joystick/windows/SDL_mmjoystick.c	Thu Aug 29 08:27:25 2013 -0700
+++ b/src/joystick/windows/SDL_mmjoystick.c	Thu Aug 29 08:29:21 2013 -0700
@@ -384,11 +384,9 @@
 void
 SDL_SYS_JoystickClose(SDL_Joystick * joystick)
 {
-    if (joystick->hwdata != NULL) {
-        /* free system specific hardware data */
-        SDL_free(joystick->hwdata);
-        joystick->hwdata = NULL;
-    }
+    /* free system specific hardware data */
+    SDL_free(joystick->hwdata);
+    joystick->hwdata = NULL;
 }
 
 /* Function to perform any system-specific joystick related cleanup */
@@ -397,10 +395,8 @@
 {
     int i;
     for (i = 0; i < MAX_JOYSTICKS; i++) {
-        if (SYS_JoystickName[i] != NULL) {
-            SDL_free(SYS_JoystickName[i]);
-            SYS_JoystickName[i] = NULL;
-        }
+        SDL_free(SYS_JoystickName[i]);
+        SYS_JoystickName[i] = NULL;
     }
 }
 
--- a/src/render/SDL_render.c	Thu Aug 29 08:27:25 2013 -0700
+++ b/src/render/SDL_render.c	Thu Aug 29 08:29:21 2013 -0700
@@ -1712,9 +1712,7 @@
     if (texture->yuv) {
         SDL_SW_DestroyYUVTexture(texture->yuv);
     }
-    if (texture->pixels) {
-        SDL_free(texture->pixels);
-    }
+    SDL_free(texture->pixels);
 
     renderer->DestroyTexture(renderer, texture);
     SDL_free(texture);
--- a/src/render/SDL_yuv_sw.c	Thu Aug 29 08:27:25 2013 -0700
+++ b/src/render/SDL_yuv_sw.c	Thu Aug 29 08:29:21 2013 -0700
@@ -1335,15 +1335,9 @@
 SDL_SW_DestroyYUVTexture(SDL_SW_YUVTexture * swdata)
 {
     if (swdata) {
-        if (swdata->pixels) {
-            SDL_free(swdata->pixels);
-        }
-        if (swdata->colortab) {
-            SDL_free(swdata->colortab);
-        }
-        if (swdata->rgb_2_pix) {
-            SDL_free(swdata->rgb_2_pix);
-        }
+        SDL_free(swdata->pixels);
+        SDL_free(swdata->colortab);
+        SDL_free(swdata->rgb_2_pix);
         if (swdata->stretch) {
             SDL_FreeSurface(swdata->stretch);
         }
--- a/src/render/direct3d/SDL_render_d3d.c	Thu Aug 29 08:27:25 2013 -0700
+++ b/src/render/direct3d/SDL_render_d3d.c	Thu Aug 29 08:29:21 2013 -0700
@@ -1813,9 +1813,7 @@
     if (data->vtexture) {
         IDirect3DTexture9_Release(data->vtexture);
     }
-    if (data->pixels) {
-        SDL_free(data->pixels);
-    }
+    SDL_free(data->pixels);
     SDL_free(data);
     texture->driverdata = NULL;
 }
--- a/src/render/opengl/SDL_render_gl.c	Thu Aug 29 08:27:25 2013 -0700
+++ b/src/render/opengl/SDL_render_gl.c	Thu Aug 29 08:29:21 2013 -0700
@@ -1318,9 +1318,7 @@
         renderdata->glDeleteTextures(1, &data->utexture);
         renderdata->glDeleteTextures(1, &data->vtexture);
     }
-    if (data->pixels) {
-        SDL_free(data->pixels);
-    }
+    SDL_free(data->pixels);
     SDL_free(data);
     texture->driverdata = NULL;
 }
--- a/src/render/opengles/SDL_render_gles.c	Thu Aug 29 08:27:25 2013 -0700
+++ b/src/render/opengles/SDL_render_gles.c	Thu Aug 29 08:29:21 2013 -0700
@@ -573,9 +573,7 @@
                     data->format,
                     data->formattype,
                     src);
-    if (blob) {
-        SDL_free(blob);
-    }
+    SDL_free(blob);
 
     if (renderdata->glGetError() != GL_NO_ERROR)
     {
@@ -1116,9 +1114,7 @@
     if (data->texture) {
         renderdata->glDeleteTextures(1, &data->texture);
     }
-    if (data->pixels) {
-        SDL_free(data->pixels);
-    }
+    SDL_free(data->pixels);
     SDL_free(data);
     texture->driverdata = NULL;
 }
--- a/src/render/opengles2/SDL_render_gles2.c	Thu Aug 29 08:27:25 2013 -0700
+++ b/src/render/opengles2/SDL_render_gles2.c	Thu Aug 29 08:29:21 2013 -0700
@@ -336,9 +336,7 @@
             }
             SDL_GL_DeleteContext(rdata->context);
         }
-        if (rdata->shader_formats) {
-            SDL_free(rdata->shader_formats);
-        }
+        SDL_free(rdata->shader_formats);
         SDL_free(rdata);
     }
     SDL_free(renderer);
@@ -541,9 +539,7 @@
                     tdata->pixel_format,
                     tdata->pixel_type,
                     src);
-    if (blob) {
-        SDL_free(blob);
-    }
+    SDL_free(blob);
 
     if (rdata->glGetError() != GL_NO_ERROR) {
         return SDL_SetError("Failed to update texture");
--- a/src/render/psp/SDL_render_psp.c	Thu Aug 29 08:27:25 2013 -0700
+++ b/src/render/psp/SDL_render_psp.c	Thu Aug 29 08:29:21 2013 -0700
@@ -988,10 +988,7 @@
     if(psp_texture == 0)
         return;
 
-    if(psp_texture->data != 0)
-    {
-        SDL_free(psp_texture->data);
-    }
+    SDL_free(psp_texture->data);
     SDL_free(psp_texture);
     texture->driverdata = NULL;
 }
--- a/src/render/software/SDL_render_sw.c	Thu Aug 29 08:27:25 2013 -0700
+++ b/src/render/software/SDL_render_sw.c	Thu Aug 29 08:29:21 2013 -0700
@@ -718,9 +718,7 @@
 {
     SW_RenderData *data = (SW_RenderData *) renderer->driverdata;
 
-    if (data) {
-        SDL_free(data);
-    }
+    SDL_free(data);
     SDL_free(renderer);
 }
 
--- a/src/stdlib/SDL_iconv.c	Thu Aug 29 08:27:25 2013 -0700
+++ b/src/stdlib/SDL_iconv.c	Thu Aug 29 08:29:21 2013 -0700
@@ -843,7 +843,7 @@
 int
 SDL_iconv_close(SDL_iconv_t cd)
 {
-    if (cd && cd != (SDL_iconv_t) - 1) {
+    if (cd != (SDL_iconv_t)-1) {
         SDL_free(cd);
     }
     return 0;
--- a/src/test/SDL_test_common.c	Thu Aug 29 08:27:25 2013 -0700
+++ b/src/test/SDL_test_common.c	Thu Aug 29 08:29:21 2013 -0700
@@ -1388,9 +1388,7 @@
 {
     int i;
 
-    if (state->windows) {
-        SDL_free(state->windows);
-    }
+    SDL_free(state->windows);
     if (state->renderers) {
         for (i = 0; i < state->num_windows; ++i) {
             if (state->renderers[i]) {
--- a/src/video/SDL_RLEaccel.c	Thu Aug 29 08:27:25 2013 -0700
+++ b/src/video/SDL_RLEaccel.c	Thu Aug 29 08:29:21 2013 -0700
@@ -1558,10 +1558,8 @@
         surface->map->info.flags &=
             ~(SDL_COPY_RLE_COLORKEY | SDL_COPY_RLE_ALPHAKEY);
 
-        if (surface->map->data) {
-            SDL_free(surface->map->data);
-            surface->map->data = NULL;
-        }
+        SDL_free(surface->map->data);
+        surface->map->data = NULL;
     }
 }
 
--- a/src/video/SDL_clipboard.c	Thu Aug 29 08:27:25 2013 -0700
+++ b/src/video/SDL_clipboard.c	Thu Aug 29 08:29:21 2013 -0700
@@ -35,9 +35,7 @@
     if (_this->SetClipboardText) {
         return _this->SetClipboardText(_this, text);
     } else {
-        if (_this->clipboard_text) {
-            SDL_free(_this->clipboard_text);
-        }
+        SDL_free(_this->clipboard_text);
         _this->clipboard_text = SDL_strdup(text);
         return 0;
     }
--- a/src/video/SDL_pixels.c	Thu Aug 29 08:27:25 2013 -0700
+++ b/src/video/SDL_pixels.c	Thu Aug 29 08:29:21 2013 -0700
@@ -707,9 +707,7 @@
     if (--palette->refcount > 0) {
         return;
     }
-    if (palette->colors) {
-        SDL_free(palette->colors);
-    }
+    SDL_free(palette->colors);
     SDL_free(palette);
 }
 
@@ -985,10 +983,8 @@
     map->dst = NULL;
     map->src_palette_version = 0;
     map->dst_palette_version = 0;
-    if (map->info.table) {
-        SDL_free(map->info.table);
-        map->info.table = NULL;
-    }
+    SDL_free(map->info.table);
+    map->info.table = NULL;
 }
 
 int
--- a/src/video/SDL_surface.c	Thu Aug 29 08:27:25 2013 -0700
+++ b/src/video/SDL_surface.c	Thu Aug 29 08:29:21 2013 -0700
@@ -1076,7 +1076,7 @@
         SDL_FreeBlitMap(surface->map);
         surface->map = NULL;
     }
-    if (surface->pixels && ((surface->flags & SDL_PREALLOC) != SDL_PREALLOC)) {
+    if (!(surface->flags & SDL_PREALLOC)) {
         SDL_free(surface->pixels);
     }
     SDL_free(surface);
--- a/src/video/SDL_video.c	Thu Aug 29 08:27:25 2013 -0700
+++ b/src/video/SDL_video.c	Thu Aug 29 08:29:21 2013 -0700
@@ -263,10 +263,8 @@
         SDL_DestroyTexture(data->texture);
         data->texture = NULL;
     }
-    if (data->pixels) {
-        SDL_free(data->pixels);
-        data->pixels = NULL;
-    }
+    SDL_free(data->pixels);
+    data->pixels = NULL;
 
     if (SDL_GetRendererInfo(data->renderer, &info) < 0) {
         return -1;
@@ -351,9 +349,7 @@
     if (data->renderer) {
         SDL_DestroyRenderer(data->renderer);
     }
-    if (data->pixels) {
-        SDL_free(data->pixels);
-    }
+    SDL_free(data->pixels);
     SDL_free(data);
 }
 
@@ -1407,9 +1403,7 @@
     if (title == window->title) {
         return;
     }
-    if (window->title) {
-        SDL_free(window->title);
-    }
+    SDL_free(window->title);
     if (title && *title) {
         window->title = SDL_strdup(title);
     } else {
@@ -2188,15 +2182,11 @@
     window->magic = NULL;
 
     /* Free memory associated with the window */
-    if (window->title) {
-        SDL_free(window->title);
-    }
+    SDL_free(window->title);
     if (window->icon) {
         SDL_FreeSurface(window->icon);
     }
-    if (window->gamma) {
-        SDL_free(window->gamma);
-    }
+    SDL_free(window->gamma);
     while (window->data) {
         SDL_WindowUserData *data = window->data;
 
@@ -2283,23 +2273,15 @@
     for (i = 0; i < _this->num_displays; ++i) {
         SDL_VideoDisplay *display = &_this->displays[i];
         for (j = display->num_display_modes; j--;) {
-            if (display->display_modes[j].driverdata) {
-                SDL_free(display->display_modes[j].driverdata);
-                display->display_modes[j].driverdata = NULL;
-            }
-        }
-        if (display->display_modes) {
-            SDL_free(display->display_modes);
-            display->display_modes = NULL;
+            SDL_free(display->display_modes[j].driverdata);
+            display->display_modes[j].driverdata = NULL;
         }
-        if (display->desktop_mode.driverdata) {
-            SDL_free(display->desktop_mode.driverdata);
-            display->desktop_mode.driverdata = NULL;
-        }
-        if (display->driverdata) {
-            SDL_free(display->driverdata);
-            display->driverdata = NULL;
-        }
+        SDL_free(display->display_modes);
+        display->display_modes = NULL;
+        SDL_free(display->desktop_mode.driverdata);
+        display->desktop_mode.driverdata = NULL;
+        SDL_free(display->driverdata);
+        display->driverdata = NULL;
     }
     if (_this->displays) {
         for (i = 0; i < _this->num_displays; ++i) {
@@ -2309,10 +2291,8 @@
         _this->displays = NULL;
         _this->num_displays = 0;
     }
-    if (_this->clipboard_text) {
-        SDL_free(_this->clipboard_text);
-        _this->clipboard_text = NULL;
-    }
+    SDL_free(_this->clipboard_text);
+    _this->clipboard_text = NULL;
     _this->free(_this);
     _this = NULL;
 }
--- a/src/video/cocoa/SDL_cocoamodes.m	Thu Aug 29 08:27:25 2013 -0700
+++ b/src/video/cocoa/SDL_cocoamodes.m	Thu Aug 29 08:29:21 2013 -0700
@@ -281,7 +281,7 @@
             display.name = (char *)Cocoa_GetDisplayName(displays[i]);
             if (!GetDisplayMode (_this, moderef, &mode)) {
                 Cocoa_ReleaseDisplayMode(_this, moderef);
-                if (display.name) SDL_free(display.name);
+                SDL_free(display.name);
                 SDL_free(displaydata);
                 continue;
             }
@@ -290,7 +290,7 @@
             display.current_mode = mode;
             display.driverdata = displaydata;
             SDL_AddVideoDisplay(&display);
-            if (display.name) SDL_free(display.name);
+            SDL_free(display.name);
         }
     }
     SDL_stack_free(displays);
--- a/src/video/cocoa/SDL_cocoavideo.m	Thu Aug 29 08:27:25 2013 -0700
+++ b/src/video/cocoa/SDL_cocoavideo.m	Thu Aug 29 08:29:21 2013 -0700
@@ -71,9 +71,7 @@
     }
     if (!data) {
         SDL_OutOfMemory();
-        if (device) {
-            SDL_free(device);
-        }
+        SDL_free(device);
         return NULL;
     }
     device->driverdata = data;
--- a/src/video/directfb/SDL_DirectFB_render.c	Thu Aug 29 08:27:25 2013 -0700
+++ b/src/video/directfb/SDL_DirectFB_render.c	Thu Aug 29 08:29:21 2013 -0700
@@ -1226,9 +1226,7 @@
     }
 #endif
 
-    if (data) {
-        SDL_free(data);
-    }
+    SDL_free(data);
     SDL_free(renderer);
 }
 
--- a/src/video/directfb/SDL_DirectFB_video.h	Thu Aug 29 08:27:25 2013 -0700
+++ b/src/video/directfb/SDL_DirectFB_video.h	Thu Aug 29 08:29:21 2013 -0700
@@ -76,7 +76,7 @@
 #define DFBENV_USE_WM               "SDL_DIRECTFB_WM"       /* Default: off  */
 
 #define SDL_DFB_RELEASE(x) do { if ( (x) != NULL ) { SDL_DFB_CHECK(x->Release(x)); x = NULL; } } while (0)
-#define SDL_DFB_FREE(x) do { if ( (x) != NULL ) { SDL_free(x); x = NULL; } } while (0)
+#define SDL_DFB_FREE(x) do { SDL_free((x)); (x) = NULL; } while (0)
 #define SDL_DFB_UNLOCK(x) do { if ( (x) != NULL ) { x->Unlock(x); } } while (0)
 
 #define SDL_DFB_CONTEXT "SDL_DirectFB"
--- a/src/video/dummy/SDL_nullvideo.c	Thu Aug 29 08:27:25 2013 -0700
+++ b/src/video/dummy/SDL_nullvideo.c	Thu Aug 29 08:29:21 2013 -0700
@@ -82,9 +82,7 @@
     device = (SDL_VideoDevice *) SDL_calloc(1, sizeof(SDL_VideoDevice));
     if (!device) {
         SDL_OutOfMemory();
-        if (device) {
-            SDL_free(device);
-        }
+        SDL_free(device);
         return (0);
     }
 
--- a/src/video/uikit/SDL_uikitvideo.m	Thu Aug 29 08:27:25 2013 -0700
+++ b/src/video/uikit/SDL_uikitvideo.m	Thu Aug 29 08:29:21 2013 -0700
@@ -63,9 +63,7 @@
     /* Initialize all variables that we clean on shutdown */
     device = (SDL_VideoDevice *) SDL_calloc(1, sizeof(SDL_VideoDevice));
     if (!device) {
-        if (device) {
-            SDL_free(device);
-        }
+        SDL_free(device);
         SDL_OutOfMemory();
         return (0);
     }
--- a/src/video/windows/SDL_windowsmessagebox.c	Thu Aug 29 08:27:25 2013 -0700
+++ b/src/video/windows/SDL_windowsmessagebox.c	Thu Aug 29 08:29:21 2013 -0700
@@ -233,9 +233,7 @@
 
 static void FreeDialogData(WIN_DialogData *dialog)
 {
-    if (dialog->data) {
-        SDL_free(dialog->data);
-    }
+    SDL_free(dialog->data);
     SDL_free(dialog);
 }
 
--- a/src/video/windows/SDL_windowsvideo.c	Thu Aug 29 08:27:25 2013 -0700
+++ b/src/video/windows/SDL_windowsvideo.c	Thu Aug 29 08:29:21 2013 -0700
@@ -75,9 +75,7 @@
         data = NULL;
     }
     if (!data) {
-        if (device) {
-            SDL_free(device);
-        }
+        SDL_free(device);
         SDL_OutOfMemory();
         return NULL;
     }
--- a/src/video/windows/SDL_windowswindow.c	Thu Aug 29 08:27:25 2013 -0700
+++ b/src/video/windows/SDL_windowswindow.c	Thu Aug 29 08:29:21 2013 -0700
@@ -319,9 +319,7 @@
         title = NULL;
     }
     SetWindowText(hwnd, title ? title : TEXT(""));
-    if (title) {
-        SDL_free(title);
-    }
+    SDL_free(title);
 }
 
 void
--- a/src/video/x11/SDL_x11opengl.c	Thu Aug 29 08:27:25 2013 -0700
+++ b/src/video/x11/SDL_x11opengl.c	Thu Aug 29 08:29:21 2013 -0700
@@ -267,10 +267,8 @@
 #endif
 
     /* Free OpenGL memory */
-    if (_this->gl_data) {
-        SDL_free(_this->gl_data);
-        _this->gl_data = NULL;
-    }
+    SDL_free(_this->gl_data);
+    _this->gl_data = NULL;
 }
 
 static SDL_bool
--- a/src/video/x11/SDL_x11video.c	Thu Aug 29 08:27:25 2013 -0700
+++ b/src/video/x11/SDL_x11video.c	Thu Aug 29 08:29:21 2013 -0700
@@ -565,9 +565,7 @@
 {
     SDL_VideoData *data = (SDL_VideoData *) _this->driverdata;
 
-    if (data->classname) {
-        SDL_free(data->classname);
-    }
+    SDL_free(data->classname);
 #ifdef X_HAVE_UTF8_STRING
     if (data->im) {
         XCloseIM(data->im);
--- a/test/testautomation.c	Thu Aug 29 08:27:25 2013 -0700
+++ b/test/testautomation.c	Thu Aug 29 08:29:21 2013 -0700
@@ -113,12 +113,8 @@
     }
 
     /* Clean up */
-    if (userRunSeed != NULL) {
-        SDL_free(userRunSeed);
-    }
-    if (filter != NULL) {
-        SDL_free(filter);
-    }
+    SDL_free(userRunSeed);
+    SDL_free(filter);
 
     /* Shutdown everything */
     quit(result);
--- a/test/testautomation_audio.c	Thu Aug 29 08:27:25 2013 -0700
+++ b/test/testautomation_audio.c	Thu Aug 29 08:29:21 2013 -0700
@@ -747,11 +747,9 @@
             SDLTest_AssertCheck(cvt.len_ratio > 0.0, "Verify conversion length ratio; expected: >0; got: %f", cvt.len_ratio);
 
             /* Free converted buffer */
-            if (cvt.buf != NULL) {
             SDL_free(cvt.buf);
             cvt.buf = NULL;
-        }
-      }
+          }
         }
       }
     }
--- a/test/testautomation_clipboard.c	Thu Aug 29 08:27:25 2013 -0700
+++ b/test/testautomation_clipboard.c	Thu Aug 29 08:29:21 2013 -0700
@@ -41,7 +41,7 @@
     charResult = SDL_GetClipboardText();
     SDLTest_AssertPass("Call to SDL_GetClipboardText succeeded");
 
-    if (charResult) SDL_free(charResult);
+    SDL_free(charResult);
 
     return TEST_COMPLETED;
 }
@@ -69,8 +69,8 @@
         textRef, text);
 
     /* Cleanup */
-    if (textRef) SDL_free(textRef);
-    if (text) SDL_free(text);
+    SDL_free(textRef);
+    SDL_free(text);
 
    return TEST_COMPLETED;
 }
@@ -145,9 +145,9 @@
         textRef, charResult);
 
     /* Cleanup */
-    if (textRef) SDL_free(textRef);
-    if (text) SDL_free(text);
-    if (charResult) SDL_free(charResult);
+    SDL_free(textRef);
+    SDL_free(text);
+    SDL_free(charResult);
 
    return TEST_COMPLETED;
 }
--- a/test/testautomation_render.c	Thu Aug 29 08:27:25 2013 -0700
+++ b/test/testautomation_render.c	Thu Aug 29 08:29:21 2013 -0700
@@ -995,9 +995,7 @@
    SDLTest_AssertCheck(result == 0, "Validate result from SDLTest_CompareSurfaces, expected: 0, got: %i", result);
 
    /* Clean up. */
-   if (pixels != NULL) {
-       SDL_free(pixels);
-   }
+   SDL_free(pixels);
    if (testSurface != NULL) {
        SDL_FreeSurface(testSurface);
    }
--- a/test/testautomation_video.c	Thu Aug 29 08:27:25 2013 -0700
+++ b/test/testautomation_video.c	Thu Aug 29 08:29:21 2013 -0700
@@ -1714,10 +1714,10 @@
   _destroyVideoSuiteTestWindow(window);
 
   cleanup:
-  if (referenceUserdata != NULL) SDL_free(referenceUserdata);
-  if (referenceUserdata2 != NULL) SDL_free(referenceUserdata2);
-  if (userdata != NULL) SDL_free(userdata);
-  if (userdata2 != NULL) SDL_free(userdata2);
+  SDL_free(referenceUserdata);
+  SDL_free(referenceUserdata2);
+  SDL_free(userdata);
+  SDL_free(userdata2);
 
   return returnValue;
 }
--- a/test/testiconv.c	Thu Aug 29 08:27:25 2013 -0700
+++ b/test/testiconv.c	Thu Aug 29 08:29:21 2013 -0700
@@ -75,12 +75,8 @@
                 SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "FAIL: %s\n", formats[i]);
                 ++errors;
             }
-            if (test[0]) {
-                SDL_free(test[0]);
-            }
-            if (test[1]) {
-                SDL_free(test[1]);
-            }
+            SDL_free(test[0]);
+            SDL_free(test[1]);
         }
         test[0] = SDL_iconv_string("UTF-8", "UCS-4", ucs4, len);
         SDL_free(ucs4);
--- a/test/testsprite2.c	Thu Aug 29 08:27:25 2013 -0700
+++ b/test/testsprite2.c	Thu Aug 29 08:29:21 2013 -0700
@@ -42,15 +42,9 @@
 static void
 quit(int rc)
 {
-    if (sprites) {
-        SDL_free(sprites);
-    }
-    if (positions) {
-        SDL_free(positions);
-    }
-    if (velocities) {
-        SDL_free(velocities);
-    }
+    SDL_free(sprites);
+    SDL_free(positions);
+    SDL_free(velocities);
     SDLTest_CommonQuit(state);
     exit(rc);
 }