Christoph Mallon: Remove pointless if (x) before SDL_free(x)
authorSam Lantinga <slouken@libsdl.org>
Thu, 29 Aug 2013 08:29:21 -0700
changeset 771931b5f9ff36ca
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
     1.1 --- a/src/SDL_hints.c	Thu Aug 29 08:27:25 2013 -0700
     1.2 +++ b/src/SDL_hints.c	Thu Aug 29 08:29:21 2013 -0700
     1.3 @@ -72,9 +72,7 @@
     1.4                      entry->callback(entry->userdata, name, hint->value, value);
     1.5                      entry = next;
     1.6                  }
     1.7 -                if (hint->value) {
     1.8 -                    SDL_free(hint->value);
     1.9 -                }
    1.10 +                SDL_free(hint->value);
    1.11                  hint->value = value ? SDL_strdup(value) : NULL;
    1.12              }
    1.13              hint->priority = priority;
    1.14 @@ -206,9 +204,7 @@
    1.15          SDL_hints = hint->next;
    1.16  
    1.17          SDL_free(hint->name);
    1.18 -        if (hint->value) {
    1.19 -            SDL_free(hint->value);
    1.20 -        }
    1.21 +        SDL_free(hint->value);
    1.22          for (entry = hint->callbacks; entry; ) {
    1.23              SDL_HintWatch *freeable = entry;
    1.24              entry = entry->next;
     2.1 --- a/src/audio/SDL_audio.c	Thu Aug 29 08:27:25 2013 -0700
     2.2 +++ b/src/audio/SDL_audio.c	Thu Aug 29 08:29:21 2013 -0700
     2.3 @@ -300,9 +300,7 @@
     2.4  static void
     2.5  SDL_StreamDeinit(SDL_AudioStreamer * stream)
     2.6  {
     2.7 -    if (stream->buffer != NULL) {
     2.8 -        SDL_free(stream->buffer);
     2.9 -    }
    2.10 +    SDL_free(stream->buffer);
    2.11  }
    2.12  
    2.13  #if defined(ANDROID)
    2.14 @@ -632,9 +630,7 @@
    2.15          }
    2.16      }
    2.17  
    2.18 -    if (*devices != NULL) {
    2.19 -        SDL_free(*devices);
    2.20 -    }
    2.21 +    SDL_free(*devices);
    2.22  
    2.23      *devices = NULL;
    2.24      *devCount = 0;
    2.25 @@ -761,9 +757,7 @@
    2.26      if (device->mixer_lock != NULL) {
    2.27          SDL_DestroyMutex(device->mixer_lock);
    2.28      }
    2.29 -    if (device->fake_stream != NULL) {
    2.30 -        SDL_FreeAudioMem(device->fake_stream);
    2.31 -    }
    2.32 +    SDL_FreeAudioMem(device->fake_stream);
    2.33      if (device->convert.needed) {
    2.34          SDL_FreeAudioMem(device->convert.buf);
    2.35      }
     3.1 --- a/src/audio/SDL_wave.c	Thu Aug 29 08:27:25 2013 -0700
     3.2 +++ b/src/audio/SDL_wave.c	Thu Aug 29 08:29:21 2013 -0700
     3.3 @@ -449,10 +449,8 @@
     3.4      /* Read the audio data format chunk */
     3.5      chunk.data = NULL;
     3.6      do {
     3.7 -        if (chunk.data != NULL) {
     3.8 -            SDL_free(chunk.data);
     3.9 -            chunk.data = NULL;
    3.10 -        }
    3.11 +        SDL_free(chunk.data);
    3.12 +        chunk.data = NULL;
    3.13          lenread = ReadChunk(src, &chunk);
    3.14          if (lenread < 0) {
    3.15              was_error = 1;
    3.16 @@ -549,10 +547,8 @@
    3.17      /* Read the audio data chunk */
    3.18      *audio_buf = NULL;
    3.19      do {
    3.20 -        if (*audio_buf != NULL) {
    3.21 -            SDL_free(*audio_buf);
    3.22 -            *audio_buf = NULL;
    3.23 -        }
    3.24 +        SDL_free(*audio_buf);
    3.25 +        *audio_buf = NULL;
    3.26          lenread = ReadChunk(src, &chunk);
    3.27          if (lenread < 0) {
    3.28              was_error = 1;
    3.29 @@ -583,9 +579,7 @@
    3.30      *audio_len &= ~(samplesize - 1);
    3.31  
    3.32    done:
    3.33 -    if (format != NULL) {
    3.34 -        SDL_free(format);
    3.35 -    }
    3.36 +    SDL_free(format);
    3.37      if (src) {
    3.38          if (freesrc) {
    3.39              SDL_RWclose(src);
    3.40 @@ -606,9 +600,7 @@
    3.41  void
    3.42  SDL_FreeWAV(Uint8 * audio_buf)
    3.43  {
    3.44 -    if (audio_buf != NULL) {
    3.45 -        SDL_free(audio_buf);
    3.46 -    }
    3.47 +    SDL_free(audio_buf);
    3.48  }
    3.49  
    3.50  static int
     4.1 --- a/src/audio/alsa/SDL_alsa_audio.c	Thu Aug 29 08:27:25 2013 -0700
     4.2 +++ b/src/audio/alsa/SDL_alsa_audio.c	Thu Aug 29 08:29:21 2013 -0700
     4.3 @@ -340,10 +340,8 @@
     4.4  ALSA_CloseDevice(_THIS)
     4.5  {
     4.6      if (this->hidden != NULL) {
     4.7 -        if (this->hidden->mixbuf != NULL) {
     4.8 -            SDL_FreeAudioMem(this->hidden->mixbuf);
     4.9 -            this->hidden->mixbuf = NULL;
    4.10 -        }
    4.11 +        SDL_FreeAudioMem(this->hidden->mixbuf);
    4.12 +        this->hidden->mixbuf = NULL;
    4.13          if (this->hidden->pcm_handle) {
    4.14              ALSA_snd_pcm_drain(this->hidden->pcm_handle);
    4.15              ALSA_snd_pcm_close(this->hidden->pcm_handle);
     5.1 --- a/src/audio/arts/SDL_artsaudio.c	Thu Aug 29 08:27:25 2013 -0700
     5.2 +++ b/src/audio/arts/SDL_artsaudio.c	Thu Aug 29 08:29:21 2013 -0700
     5.3 @@ -204,10 +204,8 @@
     5.4  ARTS_CloseDevice(_THIS)
     5.5  {
     5.6      if (this->hidden != NULL) {
     5.7 -        if (this->hidden->mixbuf != NULL) {
     5.8 -            SDL_FreeAudioMem(this->hidden->mixbuf);
     5.9 -            this->hidden->mixbuf = NULL;
    5.10 -        }
    5.11 +        SDL_FreeAudioMem(this->hidden->mixbuf);
    5.12 +        this->hidden->mixbuf = NULL;
    5.13          if (this->hidden->stream) {
    5.14              SDL_NAME(arts_close_stream) (this->hidden->stream);
    5.15              this->hidden->stream = 0;
     6.1 --- a/src/audio/bsd/SDL_bsdaudio.c	Thu Aug 29 08:27:25 2013 -0700
     6.2 +++ b/src/audio/bsd/SDL_bsdaudio.c	Thu Aug 29 08:29:21 2013 -0700
     6.3 @@ -214,10 +214,8 @@
     6.4  BSDAUDIO_CloseDevice(_THIS)
     6.5  {
     6.6      if (this->hidden != NULL) {
     6.7 -        if (this->hidden->mixbuf != NULL) {
     6.8 -            SDL_FreeAudioMem(this->hidden->mixbuf);
     6.9 -            this->hidden->mixbuf = NULL;
    6.10 -        }
    6.11 +        SDL_FreeAudioMem(this->hidden->mixbuf);
    6.12 +        this->hidden->mixbuf = NULL;
    6.13          if (this->hidden->audio_fd >= 0) {
    6.14              close(this->hidden->audio_fd);
    6.15              this->hidden->audio_fd = -1;
     7.1 --- a/src/audio/disk/SDL_diskaudio.c	Thu Aug 29 08:27:25 2013 -0700
     7.2 +++ b/src/audio/disk/SDL_diskaudio.c	Thu Aug 29 08:29:21 2013 -0700
     7.3 @@ -88,10 +88,8 @@
     7.4  DISKAUD_CloseDevice(_THIS)
     7.5  {
     7.6      if (this->hidden != NULL) {
     7.7 -        if (this->hidden->mixbuf != NULL) {
     7.8 -            SDL_FreeAudioMem(this->hidden->mixbuf);
     7.9 -            this->hidden->mixbuf = NULL;
    7.10 -        }
    7.11 +        SDL_FreeAudioMem(this->hidden->mixbuf);
    7.12 +        this->hidden->mixbuf = NULL;
    7.13          if (this->hidden->output != NULL) {
    7.14              SDL_RWclose(this->hidden->output);
    7.15              this->hidden->output = NULL;
     8.1 --- a/src/audio/dsp/SDL_dspaudio.c	Thu Aug 29 08:27:25 2013 -0700
     8.2 +++ b/src/audio/dsp/SDL_dspaudio.c	Thu Aug 29 08:29:21 2013 -0700
     8.3 @@ -61,10 +61,8 @@
     8.4  DSP_CloseDevice(_THIS)
     8.5  {
     8.6      if (this->hidden != NULL) {
     8.7 -        if (this->hidden->mixbuf != NULL) {
     8.8 -            SDL_FreeAudioMem(this->hidden->mixbuf);
     8.9 -            this->hidden->mixbuf = NULL;
    8.10 -        }
    8.11 +        SDL_FreeAudioMem(this->hidden->mixbuf);
    8.12 +        this->hidden->mixbuf = NULL;
    8.13          if (this->hidden->audio_fd >= 0) {
    8.14              close(this->hidden->audio_fd);
    8.15              this->hidden->audio_fd = -1;
     9.1 --- a/src/audio/esd/SDL_esdaudio.c	Thu Aug 29 08:27:25 2013 -0700
     9.2 +++ b/src/audio/esd/SDL_esdaudio.c	Thu Aug 29 08:29:21 2013 -0700
     9.3 @@ -176,10 +176,8 @@
     9.4  ESD_CloseDevice(_THIS)
     9.5  {
     9.6      if (this->hidden != NULL) {
     9.7 -        if (this->hidden->mixbuf != NULL) {
     9.8 -            SDL_FreeAudioMem(this->hidden->mixbuf);
     9.9 -            this->hidden->mixbuf = NULL;
    9.10 -        }
    9.11 +        SDL_FreeAudioMem(this->hidden->mixbuf);
    9.12 +        this->hidden->mixbuf = NULL;
    9.13          if (this->hidden->audio_fd >= 0) {
    9.14              SDL_NAME(esd_close) (this->hidden->audio_fd);
    9.15              this->hidden->audio_fd = -1;
    10.1 --- a/src/audio/fusionsound/SDL_fsaudio.c	Thu Aug 29 08:27:25 2013 -0700
    10.2 +++ b/src/audio/fusionsound/SDL_fsaudio.c	Thu Aug 29 08:29:21 2013 -0700
    10.3 @@ -169,10 +169,8 @@
    10.4  SDL_FS_CloseDevice(_THIS)
    10.5  {
    10.6      if (this->hidden != NULL) {
    10.7 -        if (this->hidden->mixbuf != NULL) {
    10.8 -            SDL_FreeAudioMem(this->hidden->mixbuf);
    10.9 -            this->hidden->mixbuf = NULL;
   10.10 -        }
   10.11 +        SDL_FreeAudioMem(this->hidden->mixbuf);
   10.12 +        this->hidden->mixbuf = NULL;
   10.13          if (this->hidden->stream) {
   10.14              this->hidden->stream->Release(this->hidden->stream);
   10.15              this->hidden->stream = NULL;
    11.1 --- a/src/audio/nas/SDL_nasaudio.c	Thu Aug 29 08:27:25 2013 -0700
    11.2 +++ b/src/audio/nas/SDL_nasaudio.c	Thu Aug 29 08:29:21 2013 -0700
    11.3 @@ -191,10 +191,8 @@
    11.4  NAS_CloseDevice(_THIS)
    11.5  {
    11.6      if (this->hidden != NULL) {
    11.7 -        if (this->hidden->mixbuf != NULL) {
    11.8 -            SDL_FreeAudioMem(this->hidden->mixbuf);
    11.9 -            this->hidden->mixbuf = NULL;
   11.10 -        }
   11.11 +        SDL_FreeAudioMem(this->hidden->mixbuf);
   11.12 +        this->hidden->mixbuf = NULL;
   11.13          if (this->hidden->aud) {
   11.14              NAS_AuCloseServer(this->hidden->aud);
   11.15              this->hidden->aud = 0;
    12.1 --- a/src/audio/paudio/SDL_paudio.c	Thu Aug 29 08:27:25 2013 -0700
    12.2 +++ b/src/audio/paudio/SDL_paudio.c	Thu Aug 29 08:29:21 2013 -0700
    12.3 @@ -231,10 +231,8 @@
    12.4  PAUDIO_CloseDevice(_THIS)
    12.5  {
    12.6      if (this->hidden != NULL) {
    12.7 -        if (this->hidden->mixbuf != NULL) {
    12.8 -            SDL_FreeAudioMem(this->hidden->mixbuf);
    12.9 -            this->hidden->mixbuf = NULL;
   12.10 -        }
   12.11 +        SDL_FreeAudioMem(this->hidden->mixbuf);
   12.12 +        this->hidden->mixbuf = NULL;
   12.13          if (this->hidden->audio_fd >= 0) {
   12.14              close(this->hidden->audio_fd);
   12.15              this->hidden->audio_fd = -1;
    13.1 --- a/src/audio/pulseaudio/SDL_pulseaudio.c	Thu Aug 29 08:27:25 2013 -0700
    13.2 +++ b/src/audio/pulseaudio/SDL_pulseaudio.c	Thu Aug 29 08:29:21 2013 -0700
    13.3 @@ -300,10 +300,8 @@
    13.4  PULSEAUDIO_CloseDevice(_THIS)
    13.5  {
    13.6      if (this->hidden != NULL) {
    13.7 -        if (this->hidden->mixbuf != NULL) {
    13.8 -            SDL_FreeAudioMem(this->hidden->mixbuf);
    13.9 -            this->hidden->mixbuf = NULL;
   13.10 -        }
   13.11 +        SDL_FreeAudioMem(this->hidden->mixbuf);
   13.12 +        this->hidden->mixbuf = NULL;
   13.13          if (this->hidden->stream) {
   13.14              PULSEAUDIO_pa_stream_disconnect(this->hidden->stream);
   13.15              PULSEAUDIO_pa_stream_unref(this->hidden->stream);
    14.1 --- a/src/audio/qsa/SDL_qsa_audio.c	Thu Aug 29 08:27:25 2013 -0700
    14.2 +++ b/src/audio/qsa/SDL_qsa_audio.c	Thu Aug 29 08:29:21 2013 -0700
    14.3 @@ -328,10 +328,8 @@
    14.4              this->hidden->audio_handle = NULL;
    14.5          }
    14.6  
    14.7 -        if (this->hidden->pcm_buf != NULL) {
    14.8 -            SDL_FreeAudioMem(this->hidden->pcm_buf);
    14.9 -            this->hidden->pcm_buf = NULL;
   14.10 -        }
   14.11 +        SDL_FreeAudioMem(this->hidden->pcm_buf);
   14.12 +        this->hidden->pcm_buf = NULL;
   14.13  
   14.14          SDL_free(this->hidden);
   14.15          this->hidden = NULL;
    15.1 --- a/src/audio/sndio/SDL_sndioaudio.c	Thu Aug 29 08:27:25 2013 -0700
    15.2 +++ b/src/audio/sndio/SDL_sndioaudio.c	Thu Aug 29 08:29:21 2013 -0700
    15.3 @@ -181,10 +181,8 @@
    15.4  SNDIO_CloseDevice(_THIS)
    15.5  {
    15.6      if (this->hidden != NULL) {
    15.7 -        if (this->hidden->mixbuf != NULL) {
    15.8 -            SDL_FreeAudioMem(this->hidden->mixbuf);
    15.9 -            this->hidden->mixbuf = NULL;
   15.10 -        }
   15.11 +        SDL_FreeAudioMem(this->hidden->mixbuf);
   15.12 +        this->hidden->mixbuf = NULL;
   15.13          if ( this->hidden->dev != NULL ) {
   15.14              SNDIO_sio_close(this->hidden->dev);
   15.15              this->hidden->dev = NULL;
    16.1 --- a/src/audio/sun/SDL_sunaudio.c	Thu Aug 29 08:27:25 2013 -0700
    16.2 +++ b/src/audio/sun/SDL_sunaudio.c	Thu Aug 29 08:29:21 2013 -0700
    16.3 @@ -184,14 +184,10 @@
    16.4  SUNAUDIO_CloseDevice(_THIS)
    16.5  {
    16.6      if (this->hidden != NULL) {
    16.7 -        if (this->hidden->mixbuf != NULL) {
    16.8 -            SDL_FreeAudioMem(this->hidden->mixbuf);
    16.9 -            this->hidden->mixbuf = NULL;
   16.10 -        }
   16.11 -        if (this->hidden->ulaw_buf != NULL) {
   16.12 -            SDL_free(this->hidden->ulaw_buf);
   16.13 -            this->hidden->ulaw_buf = NULL;
   16.14 -        }
   16.15 +        SDL_FreeAudioMem(this->hidden->mixbuf);
   16.16 +        this->hidden->mixbuf = NULL;
   16.17 +        SDL_free(this->hidden->ulaw_buf);
   16.18 +        this->hidden->ulaw_buf = NULL;
   16.19          if (this->hidden->audio_fd >= 0) {
   16.20              close(this->hidden->audio_fd);
   16.21              this->hidden->audio_fd = -1;
    17.1 --- a/src/audio/winmm/SDL_winmm.c	Thu Aug 29 08:27:25 2013 -0700
    17.2 +++ b/src/audio/winmm/SDL_winmm.c	Thu Aug 29 08:29:21 2013 -0700
    17.3 @@ -176,11 +176,9 @@
    17.4              }
    17.5          }
    17.6  
    17.7 -        if (this->hidden->mixbuf != NULL) {
    17.8 -            /* Free raw mixing buffer */
    17.9 -            SDL_free(this->hidden->mixbuf);
   17.10 -            this->hidden->mixbuf = NULL;
   17.11 -        }
   17.12 +        /* Free raw mixing buffer */
   17.13 +        SDL_free(this->hidden->mixbuf);
   17.14 +        this->hidden->mixbuf = NULL;
   17.15  
   17.16          if (this->hidden->hin) {
   17.17              waveInClose(this->hidden->hin);
    18.1 --- a/src/audio/xaudio2/SDL_xaudio2.c	Thu Aug 29 08:27:25 2013 -0700
    18.2 +++ b/src/audio/xaudio2/SDL_xaudio2.c	Thu Aug 29 08:29:21 2013 -0700
    18.3 @@ -205,9 +205,7 @@
    18.4          if (ixa2 != NULL) {
    18.5              IXAudio2_Release(ixa2);
    18.6          }
    18.7 -        if (this->hidden->mixbuf != NULL) {
    18.8 -            SDL_free(this->hidden->mixbuf);
    18.9 -        }
   18.10 +        SDL_free(this->hidden->mixbuf);
   18.11          if (this->hidden->semaphore != NULL) {
   18.12              CloseHandle(this->hidden->semaphore);
   18.13          }
    19.1 --- a/src/events/SDL_events.c	Thu Aug 29 08:27:25 2013 -0700
    19.2 +++ b/src/events/SDL_events.c	Thu Aug 29 08:29:21 2013 -0700
    19.3 @@ -141,10 +141,8 @@
    19.4  
    19.5      /* Clear disabled event state */
    19.6      for (i = 0; i < SDL_arraysize(SDL_disabled_events); ++i) {
    19.7 -        if (SDL_disabled_events[i]) {
    19.8 -            SDL_free(SDL_disabled_events[i]);
    19.9 -            SDL_disabled_events[i] = NULL;
   19.10 -        }
   19.11 +        SDL_free(SDL_disabled_events[i]);
   19.12 +        SDL_disabled_events[i] = NULL;
   19.13      }
   19.14  
   19.15      while (SDL_event_watchers) {
    20.1 --- a/src/events/SDL_touch.c	Thu Aug 29 08:27:25 2013 -0700
    20.2 +++ b/src/events/SDL_touch.c	Thu Aug 29 08:29:21 2013 -0700
    20.3 @@ -355,10 +355,8 @@
    20.4      }
    20.5      SDL_assert(SDL_num_touch == 0);
    20.6  
    20.7 -    if (SDL_touchDevices) {
    20.8 -        SDL_free(SDL_touchDevices);
    20.9 -        SDL_touchDevices = NULL;
   20.10 -    }
   20.11 +    SDL_free(SDL_touchDevices);
   20.12 +    SDL_touchDevices = NULL;
   20.13  }
   20.14  
   20.15  /* vi: set ts=4 sw=4 expandtab: */
    21.1 --- a/src/file/SDL_rwops.c	Thu Aug 29 08:27:25 2013 -0700
    21.2 +++ b/src/file/SDL_rwops.c	Thu Aug 29 08:29:21 2013 -0700
    21.3 @@ -275,10 +275,8 @@
    21.4              CloseHandle(context->hidden.windowsio.h);
    21.5              context->hidden.windowsio.h = INVALID_HANDLE_VALUE;   /* to be sure */
    21.6          }
    21.7 -        if (context->hidden.windowsio.buffer.data) {
    21.8 -            SDL_free(context->hidden.windowsio.buffer.data);
    21.9 -            context->hidden.windowsio.buffer.data = NULL;
   21.10 -        }
   21.11 +        SDL_free(context->hidden.windowsio.buffer.data);
   21.12 +        context->hidden.windowsio.buffer.data = NULL;
   21.13          SDL_FreeRW(context);
   21.14      }
   21.15      return (0);
    22.1 --- a/src/filesystem/unix/SDL_sysfilesystem.c	Thu Aug 29 08:27:25 2013 -0700
    22.2 +++ b/src/filesystem/unix/SDL_sysfilesystem.c	Thu Aug 29 08:29:21 2013 -0700
    22.3 @@ -69,9 +69,7 @@
    22.4          len *= 2;  /* grow buffer, try again. */
    22.5      }
    22.6  
    22.7 -    if (retval != NULL) {
    22.8 -        SDL_free(retval);
    22.9 -    }
   22.10 +    SDL_free(retval);
   22.11      return NULL;
   22.12  }
   22.13  
    23.1 --- a/src/haptic/SDL_haptic.c	Thu Aug 29 08:27:25 2013 -0700
    23.2 +++ b/src/haptic/SDL_haptic.c	Thu Aug 29 08:29:21 2013 -0700
    23.3 @@ -379,10 +379,8 @@
    23.4  SDL_HapticQuit(void)
    23.5  {
    23.6      SDL_SYS_HapticQuit();
    23.7 -    if (SDL_haptics != NULL) {
    23.8 -        SDL_free(SDL_haptics);
    23.9 -        SDL_haptics = NULL;
   23.10 -    }
   23.11 +    SDL_free(SDL_haptics);
   23.12 +    SDL_haptics = NULL;
   23.13      SDL_numhaptics = 0;
   23.14  }
   23.15  
    24.1 --- a/src/haptic/darwin/SDL_syshaptic.c	Thu Aug 29 08:27:25 2013 -0700
    24.2 +++ b/src/haptic/darwin/SDL_syshaptic.c	Thu Aug 29 08:29:21 2013 -0700
    24.3 @@ -943,14 +943,10 @@
    24.4  {
    24.5      FFCUSTOMFORCE *custom;
    24.6  
    24.7 -    if (effect->lpEnvelope != NULL) {
    24.8 -        SDL_free(effect->lpEnvelope);
    24.9 -        effect->lpEnvelope = NULL;
   24.10 -    }
   24.11 -    if (effect->rgdwAxes != NULL) {
   24.12 -        SDL_free(effect->rgdwAxes);
   24.13 -        effect->rgdwAxes = NULL;
   24.14 -    }
   24.15 +    SDL_free(effect->lpEnvelope);
   24.16 +    effect->lpEnvelope = NULL;
   24.17 +    SDL_free(effect->rgdwAxes);
   24.18 +    effect->rgdwAxes = NULL;
   24.19      if (effect->lpvTypeSpecificParams != NULL) {
   24.20          if (type == SDL_HAPTIC_CUSTOM) {        /* Must free the custom data. */
   24.21              custom = (FFCUSTOMFORCE *) effect->lpvTypeSpecificParams;
   24.22 @@ -960,10 +956,8 @@
   24.23          SDL_free(effect->lpvTypeSpecificParams);
   24.24          effect->lpvTypeSpecificParams = NULL;
   24.25      }
   24.26 -    if (effect->rglDirection != NULL) {
   24.27 -        SDL_free(effect->rglDirection);
   24.28 -        effect->rglDirection = NULL;
   24.29 -    }
   24.30 +    SDL_free(effect->rglDirection);
   24.31 +    effect->rglDirection = NULL;
   24.32  }
   24.33  
   24.34  
   24.35 @@ -1061,10 +1055,8 @@
   24.36    err_effectdone:
   24.37      SDL_SYS_HapticFreeFFEFFECT(&effect->hweffect->effect, base->type);
   24.38    err_hweffect:
   24.39 -    if (effect->hweffect != NULL) {
   24.40 -        SDL_free(effect->hweffect);
   24.41 -        effect->hweffect = NULL;
   24.42 -    }
   24.43 +    SDL_free(effect->hweffect);
   24.44 +    effect->hweffect = NULL;
   24.45      return -1;
   24.46  }
   24.47  
    25.1 --- a/src/haptic/windows/SDL_syshaptic.c	Thu Aug 29 08:27:25 2013 -0700
    25.2 +++ b/src/haptic/windows/SDL_syshaptic.c	Thu Aug 29 08:29:21 2013 -0700
    25.3 @@ -751,10 +751,8 @@
    25.4      }
    25.5  
    25.6      for (i = 0; i < SDL_arraysize(SDL_hapticlist); ++i) {
    25.7 -        if (SDL_hapticlist[i].name) {
    25.8 -            SDL_free(SDL_hapticlist[i].name);
    25.9 -            SDL_hapticlist[i].name = NULL;
   25.10 -        }
   25.11 +        SDL_free(SDL_hapticlist[i].name);
   25.12 +        SDL_hapticlist[i].name = NULL;
   25.13      }
   25.14  
   25.15      if (dinput != NULL) {
   25.16 @@ -1127,14 +1125,10 @@
   25.17  {
   25.18      DICUSTOMFORCE *custom;
   25.19  
   25.20 -    if (effect->lpEnvelope != NULL) {
   25.21 -        SDL_free(effect->lpEnvelope);
   25.22 -        effect->lpEnvelope = NULL;
   25.23 -    }
   25.24 -    if (effect->rgdwAxes != NULL) {
   25.25 -        SDL_free(effect->rgdwAxes);
   25.26 -        effect->rgdwAxes = NULL;
   25.27 -    }
   25.28 +    SDL_free(effect->lpEnvelope);
   25.29 +    effect->lpEnvelope = NULL;
   25.30 +    SDL_free(effect->rgdwAxes);
   25.31 +    effect->rgdwAxes = NULL;
   25.32      if (effect->lpvTypeSpecificParams != NULL) {
   25.33          if (type == SDL_HAPTIC_CUSTOM) {        /* Must free the custom data. */
   25.34              custom = (DICUSTOMFORCE *) effect->lpvTypeSpecificParams;
   25.35 @@ -1144,10 +1138,8 @@
   25.36          SDL_free(effect->lpvTypeSpecificParams);
   25.37          effect->lpvTypeSpecificParams = NULL;
   25.38      }
   25.39 -    if (effect->rglDirection != NULL) {
   25.40 -        SDL_free(effect->rglDirection);
   25.41 -        effect->rglDirection = NULL;
   25.42 -    }
   25.43 +    SDL_free(effect->rglDirection);
   25.44 +    effect->rglDirection = NULL;
   25.45  }
   25.46  
   25.47  
   25.48 @@ -1250,10 +1242,8 @@
   25.49    err_effectdone:
   25.50      SDL_SYS_HapticFreeDIEFFECT(&effect->hweffect->effect, base->type);
   25.51    err_hweffect:
   25.52 -    if (effect->hweffect != NULL) {
   25.53 -        SDL_free(effect->hweffect);
   25.54 -        effect->hweffect = NULL;
   25.55 -    }
   25.56 +    SDL_free(effect->hweffect);
   25.57 +    effect->hweffect = NULL;
   25.58      return -1;
   25.59  }
   25.60  
    26.1 --- a/src/joystick/SDL_joystick.c	Thu Aug 29 08:27:25 2013 -0700
    26.2 +++ b/src/joystick/SDL_joystick.c	Thu Aug 29 08:29:21 2013 -0700
    26.3 @@ -437,22 +437,13 @@
    26.4          joysticklist = joysticklist->next;
    26.5      }
    26.6  
    26.7 -    if (joystick->name)
    26.8 -        SDL_free(joystick->name);
    26.9 +    SDL_free(joystick->name);
   26.10  
   26.11      /* Free the data associated with this joystick */
   26.12 -    if (joystick->axes) {
   26.13 -        SDL_free(joystick->axes);
   26.14 -    }
   26.15 -    if (joystick->hats) {
   26.16 -        SDL_free(joystick->hats);
   26.17 -    }
   26.18 -    if (joystick->balls) {
   26.19 -        SDL_free(joystick->balls);
   26.20 -    }
   26.21 -    if (joystick->buttons) {
   26.22 -        SDL_free(joystick->buttons);
   26.23 -    }
   26.24 +    SDL_free(joystick->axes);
   26.25 +    SDL_free(joystick->hats);
   26.26 +    SDL_free(joystick->balls);
   26.27 +    SDL_free(joystick->buttons);
   26.28      SDL_free(joystick);
   26.29  }
   26.30  
    27.1 --- a/src/joystick/beos/SDL_bejoystick.cc	Thu Aug 29 08:27:25 2013 -0700
    27.2 +++ b/src/joystick/beos/SDL_bejoystick.cc	Thu Aug 29 08:29:21 2013 -0700
    27.3 @@ -231,12 +231,8 @@
    27.4          if (joystick->hwdata) {
    27.5              joystick->hwdata->stick->Close();
    27.6              delete joystick->hwdata->stick;
    27.7 -            if (joystick->hwdata->new_hats) {
    27.8 -                SDL_free(joystick->hwdata->new_hats);
    27.9 -            }
   27.10 -            if (joystick->hwdata->new_axes) {
   27.11 -                SDL_free(joystick->hwdata->new_axes);
   27.12 -            }
   27.13 +            SDL_free(joystick->hwdata->new_hats);
   27.14 +            SDL_free(joystick->hwdata->new_axes);
   27.15              SDL_free(joystick->hwdata);
   27.16              joystick->hwdata = NULL;
   27.17          }
    28.1 --- a/src/joystick/bsd/SDL_sysjoystick.c	Thu Aug 29 08:27:25 2013 -0700
    28.2 +++ b/src/joystick/bsd/SDL_sysjoystick.c	Thu Aug 29 08:29:21 2013 -0700
    28.3 @@ -577,10 +577,8 @@
    28.4      int i;
    28.5  
    28.6      for (i = 0; i < MAX_JOYS; i++) {
    28.7 -        if (joynames[i] != NULL)
    28.8 -            SDL_free(joynames[i]);
    28.9 -        if (joydevnames[i] != NULL)
   28.10 -            SDL_free(joydevnames[i]);
   28.11 +        SDL_free(joynames[i]);
   28.12 +        SDL_free(joydevnames[i]);
   28.13      }
   28.14  
   28.15      return;
   28.16 @@ -657,9 +655,7 @@
   28.17  static void
   28.18  report_free(struct report *r)
   28.19  {
   28.20 -    if (r->buf != NULL) {
   28.21 -        SDL_free(r->buf);
   28.22 -    }
   28.23 +    SDL_free(r->buf);
   28.24      r->status = SREPORT_UNINIT;
   28.25  }
   28.26  
    29.1 --- a/src/joystick/windows/SDL_dxjoystick.c	Thu Aug 29 08:27:25 2013 -0700
    29.2 +++ b/src/joystick/windows/SDL_dxjoystick.c	Thu Aug 29 08:29:21 2013 -0700
    29.3 @@ -834,7 +834,7 @@
    29.4  
    29.5              pListNext = pCurList->pNext;
    29.6              SDL_free(pCurList->joystickname);
    29.7 -            SDL_free( pCurList );
    29.8 +            SDL_free(pCurList);
    29.9              pCurList = pListNext;
   29.10          }
   29.11  
   29.12 @@ -1559,10 +1559,8 @@
   29.13          IDirectInputDevice8_Release(joystick->hwdata->InputDevice);
   29.14      }
   29.15  
   29.16 -    if (joystick->hwdata != NULL) {
   29.17 -        /* free system specific hardware data */
   29.18 -        SDL_free(joystick->hwdata);
   29.19 -    }
   29.20 +    /* free system specific hardware data */
   29.21 +    SDL_free(joystick->hwdata);
   29.22  
   29.23      joystick->closed = 1;
   29.24  }
    30.1 --- a/src/joystick/windows/SDL_mmjoystick.c	Thu Aug 29 08:27:25 2013 -0700
    30.2 +++ b/src/joystick/windows/SDL_mmjoystick.c	Thu Aug 29 08:29:21 2013 -0700
    30.3 @@ -384,11 +384,9 @@
    30.4  void
    30.5  SDL_SYS_JoystickClose(SDL_Joystick * joystick)
    30.6  {
    30.7 -    if (joystick->hwdata != NULL) {
    30.8 -        /* free system specific hardware data */
    30.9 -        SDL_free(joystick->hwdata);
   30.10 -        joystick->hwdata = NULL;
   30.11 -    }
   30.12 +    /* free system specific hardware data */
   30.13 +    SDL_free(joystick->hwdata);
   30.14 +    joystick->hwdata = NULL;
   30.15  }
   30.16  
   30.17  /* Function to perform any system-specific joystick related cleanup */
   30.18 @@ -397,10 +395,8 @@
   30.19  {
   30.20      int i;
   30.21      for (i = 0; i < MAX_JOYSTICKS; i++) {
   30.22 -        if (SYS_JoystickName[i] != NULL) {
   30.23 -            SDL_free(SYS_JoystickName[i]);
   30.24 -            SYS_JoystickName[i] = NULL;
   30.25 -        }
   30.26 +        SDL_free(SYS_JoystickName[i]);
   30.27 +        SYS_JoystickName[i] = NULL;
   30.28      }
   30.29  }
   30.30  
    31.1 --- a/src/render/SDL_render.c	Thu Aug 29 08:27:25 2013 -0700
    31.2 +++ b/src/render/SDL_render.c	Thu Aug 29 08:29:21 2013 -0700
    31.3 @@ -1712,9 +1712,7 @@
    31.4      if (texture->yuv) {
    31.5          SDL_SW_DestroyYUVTexture(texture->yuv);
    31.6      }
    31.7 -    if (texture->pixels) {
    31.8 -        SDL_free(texture->pixels);
    31.9 -    }
   31.10 +    SDL_free(texture->pixels);
   31.11  
   31.12      renderer->DestroyTexture(renderer, texture);
   31.13      SDL_free(texture);
    32.1 --- a/src/render/SDL_yuv_sw.c	Thu Aug 29 08:27:25 2013 -0700
    32.2 +++ b/src/render/SDL_yuv_sw.c	Thu Aug 29 08:29:21 2013 -0700
    32.3 @@ -1335,15 +1335,9 @@
    32.4  SDL_SW_DestroyYUVTexture(SDL_SW_YUVTexture * swdata)
    32.5  {
    32.6      if (swdata) {
    32.7 -        if (swdata->pixels) {
    32.8 -            SDL_free(swdata->pixels);
    32.9 -        }
   32.10 -        if (swdata->colortab) {
   32.11 -            SDL_free(swdata->colortab);
   32.12 -        }
   32.13 -        if (swdata->rgb_2_pix) {
   32.14 -            SDL_free(swdata->rgb_2_pix);
   32.15 -        }
   32.16 +        SDL_free(swdata->pixels);
   32.17 +        SDL_free(swdata->colortab);
   32.18 +        SDL_free(swdata->rgb_2_pix);
   32.19          if (swdata->stretch) {
   32.20              SDL_FreeSurface(swdata->stretch);
   32.21          }
    33.1 --- a/src/render/direct3d/SDL_render_d3d.c	Thu Aug 29 08:27:25 2013 -0700
    33.2 +++ b/src/render/direct3d/SDL_render_d3d.c	Thu Aug 29 08:29:21 2013 -0700
    33.3 @@ -1813,9 +1813,7 @@
    33.4      if (data->vtexture) {
    33.5          IDirect3DTexture9_Release(data->vtexture);
    33.6      }
    33.7 -    if (data->pixels) {
    33.8 -        SDL_free(data->pixels);
    33.9 -    }
   33.10 +    SDL_free(data->pixels);
   33.11      SDL_free(data);
   33.12      texture->driverdata = NULL;
   33.13  }
    34.1 --- a/src/render/opengl/SDL_render_gl.c	Thu Aug 29 08:27:25 2013 -0700
    34.2 +++ b/src/render/opengl/SDL_render_gl.c	Thu Aug 29 08:29:21 2013 -0700
    34.3 @@ -1318,9 +1318,7 @@
    34.4          renderdata->glDeleteTextures(1, &data->utexture);
    34.5          renderdata->glDeleteTextures(1, &data->vtexture);
    34.6      }
    34.7 -    if (data->pixels) {
    34.8 -        SDL_free(data->pixels);
    34.9 -    }
   34.10 +    SDL_free(data->pixels);
   34.11      SDL_free(data);
   34.12      texture->driverdata = NULL;
   34.13  }
    35.1 --- a/src/render/opengles/SDL_render_gles.c	Thu Aug 29 08:27:25 2013 -0700
    35.2 +++ b/src/render/opengles/SDL_render_gles.c	Thu Aug 29 08:29:21 2013 -0700
    35.3 @@ -573,9 +573,7 @@
    35.4                      data->format,
    35.5                      data->formattype,
    35.6                      src);
    35.7 -    if (blob) {
    35.8 -        SDL_free(blob);
    35.9 -    }
   35.10 +    SDL_free(blob);
   35.11  
   35.12      if (renderdata->glGetError() != GL_NO_ERROR)
   35.13      {
   35.14 @@ -1116,9 +1114,7 @@
   35.15      if (data->texture) {
   35.16          renderdata->glDeleteTextures(1, &data->texture);
   35.17      }
   35.18 -    if (data->pixels) {
   35.19 -        SDL_free(data->pixels);
   35.20 -    }
   35.21 +    SDL_free(data->pixels);
   35.22      SDL_free(data);
   35.23      texture->driverdata = NULL;
   35.24  }
    36.1 --- a/src/render/opengles2/SDL_render_gles2.c	Thu Aug 29 08:27:25 2013 -0700
    36.2 +++ b/src/render/opengles2/SDL_render_gles2.c	Thu Aug 29 08:29:21 2013 -0700
    36.3 @@ -336,9 +336,7 @@
    36.4              }
    36.5              SDL_GL_DeleteContext(rdata->context);
    36.6          }
    36.7 -        if (rdata->shader_formats) {
    36.8 -            SDL_free(rdata->shader_formats);
    36.9 -        }
   36.10 +        SDL_free(rdata->shader_formats);
   36.11          SDL_free(rdata);
   36.12      }
   36.13      SDL_free(renderer);
   36.14 @@ -541,9 +539,7 @@
   36.15                      tdata->pixel_format,
   36.16                      tdata->pixel_type,
   36.17                      src);
   36.18 -    if (blob) {
   36.19 -        SDL_free(blob);
   36.20 -    }
   36.21 +    SDL_free(blob);
   36.22  
   36.23      if (rdata->glGetError() != GL_NO_ERROR) {
   36.24          return SDL_SetError("Failed to update texture");
    37.1 --- a/src/render/psp/SDL_render_psp.c	Thu Aug 29 08:27:25 2013 -0700
    37.2 +++ b/src/render/psp/SDL_render_psp.c	Thu Aug 29 08:29:21 2013 -0700
    37.3 @@ -988,10 +988,7 @@
    37.4      if(psp_texture == 0)
    37.5          return;
    37.6  
    37.7 -    if(psp_texture->data != 0)
    37.8 -    {
    37.9 -        SDL_free(psp_texture->data);
   37.10 -    }
   37.11 +    SDL_free(psp_texture->data);
   37.12      SDL_free(psp_texture);
   37.13      texture->driverdata = NULL;
   37.14  }
    38.1 --- a/src/render/software/SDL_render_sw.c	Thu Aug 29 08:27:25 2013 -0700
    38.2 +++ b/src/render/software/SDL_render_sw.c	Thu Aug 29 08:29:21 2013 -0700
    38.3 @@ -718,9 +718,7 @@
    38.4  {
    38.5      SW_RenderData *data = (SW_RenderData *) renderer->driverdata;
    38.6  
    38.7 -    if (data) {
    38.8 -        SDL_free(data);
    38.9 -    }
   38.10 +    SDL_free(data);
   38.11      SDL_free(renderer);
   38.12  }
   38.13  
    39.1 --- a/src/stdlib/SDL_iconv.c	Thu Aug 29 08:27:25 2013 -0700
    39.2 +++ b/src/stdlib/SDL_iconv.c	Thu Aug 29 08:29:21 2013 -0700
    39.3 @@ -843,7 +843,7 @@
    39.4  int
    39.5  SDL_iconv_close(SDL_iconv_t cd)
    39.6  {
    39.7 -    if (cd && cd != (SDL_iconv_t) - 1) {
    39.8 +    if (cd != (SDL_iconv_t)-1) {
    39.9          SDL_free(cd);
   39.10      }
   39.11      return 0;
    40.1 --- a/src/test/SDL_test_common.c	Thu Aug 29 08:27:25 2013 -0700
    40.2 +++ b/src/test/SDL_test_common.c	Thu Aug 29 08:29:21 2013 -0700
    40.3 @@ -1388,9 +1388,7 @@
    40.4  {
    40.5      int i;
    40.6  
    40.7 -    if (state->windows) {
    40.8 -        SDL_free(state->windows);
    40.9 -    }
   40.10 +    SDL_free(state->windows);
   40.11      if (state->renderers) {
   40.12          for (i = 0; i < state->num_windows; ++i) {
   40.13              if (state->renderers[i]) {
    41.1 --- a/src/video/SDL_RLEaccel.c	Thu Aug 29 08:27:25 2013 -0700
    41.2 +++ b/src/video/SDL_RLEaccel.c	Thu Aug 29 08:29:21 2013 -0700
    41.3 @@ -1558,10 +1558,8 @@
    41.4          surface->map->info.flags &=
    41.5              ~(SDL_COPY_RLE_COLORKEY | SDL_COPY_RLE_ALPHAKEY);
    41.6  
    41.7 -        if (surface->map->data) {
    41.8 -            SDL_free(surface->map->data);
    41.9 -            surface->map->data = NULL;
   41.10 -        }
   41.11 +        SDL_free(surface->map->data);
   41.12 +        surface->map->data = NULL;
   41.13      }
   41.14  }
   41.15  
    42.1 --- a/src/video/SDL_clipboard.c	Thu Aug 29 08:27:25 2013 -0700
    42.2 +++ b/src/video/SDL_clipboard.c	Thu Aug 29 08:29:21 2013 -0700
    42.3 @@ -35,9 +35,7 @@
    42.4      if (_this->SetClipboardText) {
    42.5          return _this->SetClipboardText(_this, text);
    42.6      } else {
    42.7 -        if (_this->clipboard_text) {
    42.8 -            SDL_free(_this->clipboard_text);
    42.9 -        }
   42.10 +        SDL_free(_this->clipboard_text);
   42.11          _this->clipboard_text = SDL_strdup(text);
   42.12          return 0;
   42.13      }
    43.1 --- a/src/video/SDL_pixels.c	Thu Aug 29 08:27:25 2013 -0700
    43.2 +++ b/src/video/SDL_pixels.c	Thu Aug 29 08:29:21 2013 -0700
    43.3 @@ -707,9 +707,7 @@
    43.4      if (--palette->refcount > 0) {
    43.5          return;
    43.6      }
    43.7 -    if (palette->colors) {
    43.8 -        SDL_free(palette->colors);
    43.9 -    }
   43.10 +    SDL_free(palette->colors);
   43.11      SDL_free(palette);
   43.12  }
   43.13  
   43.14 @@ -985,10 +983,8 @@
   43.15      map->dst = NULL;
   43.16      map->src_palette_version = 0;
   43.17      map->dst_palette_version = 0;
   43.18 -    if (map->info.table) {
   43.19 -        SDL_free(map->info.table);
   43.20 -        map->info.table = NULL;
   43.21 -    }
   43.22 +    SDL_free(map->info.table);
   43.23 +    map->info.table = NULL;
   43.24  }
   43.25  
   43.26  int
    44.1 --- a/src/video/SDL_surface.c	Thu Aug 29 08:27:25 2013 -0700
    44.2 +++ b/src/video/SDL_surface.c	Thu Aug 29 08:29:21 2013 -0700
    44.3 @@ -1076,7 +1076,7 @@
    44.4          SDL_FreeBlitMap(surface->map);
    44.5          surface->map = NULL;
    44.6      }
    44.7 -    if (surface->pixels && ((surface->flags & SDL_PREALLOC) != SDL_PREALLOC)) {
    44.8 +    if (!(surface->flags & SDL_PREALLOC)) {
    44.9          SDL_free(surface->pixels);
   44.10      }
   44.11      SDL_free(surface);
    45.1 --- a/src/video/SDL_video.c	Thu Aug 29 08:27:25 2013 -0700
    45.2 +++ b/src/video/SDL_video.c	Thu Aug 29 08:29:21 2013 -0700
    45.3 @@ -263,10 +263,8 @@
    45.4          SDL_DestroyTexture(data->texture);
    45.5          data->texture = NULL;
    45.6      }
    45.7 -    if (data->pixels) {
    45.8 -        SDL_free(data->pixels);
    45.9 -        data->pixels = NULL;
   45.10 -    }
   45.11 +    SDL_free(data->pixels);
   45.12 +    data->pixels = NULL;
   45.13  
   45.14      if (SDL_GetRendererInfo(data->renderer, &info) < 0) {
   45.15          return -1;
   45.16 @@ -351,9 +349,7 @@
   45.17      if (data->renderer) {
   45.18          SDL_DestroyRenderer(data->renderer);
   45.19      }
   45.20 -    if (data->pixels) {
   45.21 -        SDL_free(data->pixels);
   45.22 -    }
   45.23 +    SDL_free(data->pixels);
   45.24      SDL_free(data);
   45.25  }
   45.26  
   45.27 @@ -1407,9 +1403,7 @@
   45.28      if (title == window->title) {
   45.29          return;
   45.30      }
   45.31 -    if (window->title) {
   45.32 -        SDL_free(window->title);
   45.33 -    }
   45.34 +    SDL_free(window->title);
   45.35      if (title && *title) {
   45.36          window->title = SDL_strdup(title);
   45.37      } else {
   45.38 @@ -2188,15 +2182,11 @@
   45.39      window->magic = NULL;
   45.40  
   45.41      /* Free memory associated with the window */
   45.42 -    if (window->title) {
   45.43 -        SDL_free(window->title);
   45.44 -    }
   45.45 +    SDL_free(window->title);
   45.46      if (window->icon) {
   45.47          SDL_FreeSurface(window->icon);
   45.48      }
   45.49 -    if (window->gamma) {
   45.50 -        SDL_free(window->gamma);
   45.51 -    }
   45.52 +    SDL_free(window->gamma);
   45.53      while (window->data) {
   45.54          SDL_WindowUserData *data = window->data;
   45.55  
   45.56 @@ -2283,23 +2273,15 @@
   45.57      for (i = 0; i < _this->num_displays; ++i) {
   45.58          SDL_VideoDisplay *display = &_this->displays[i];
   45.59          for (j = display->num_display_modes; j--;) {
   45.60 -            if (display->display_modes[j].driverdata) {
   45.61 -                SDL_free(display->display_modes[j].driverdata);
   45.62 -                display->display_modes[j].driverdata = NULL;
   45.63 -            }
   45.64 +            SDL_free(display->display_modes[j].driverdata);
   45.65 +            display->display_modes[j].driverdata = NULL;
   45.66          }
   45.67 -        if (display->display_modes) {
   45.68 -            SDL_free(display->display_modes);
   45.69 -            display->display_modes = NULL;
   45.70 -        }
   45.71 -        if (display->desktop_mode.driverdata) {
   45.72 -            SDL_free(display->desktop_mode.driverdata);
   45.73 -            display->desktop_mode.driverdata = NULL;
   45.74 -        }
   45.75 -        if (display->driverdata) {
   45.76 -            SDL_free(display->driverdata);
   45.77 -            display->driverdata = NULL;
   45.78 -        }
   45.79 +        SDL_free(display->display_modes);
   45.80 +        display->display_modes = NULL;
   45.81 +        SDL_free(display->desktop_mode.driverdata);
   45.82 +        display->desktop_mode.driverdata = NULL;
   45.83 +        SDL_free(display->driverdata);
   45.84 +        display->driverdata = NULL;
   45.85      }
   45.86      if (_this->displays) {
   45.87          for (i = 0; i < _this->num_displays; ++i) {
   45.88 @@ -2309,10 +2291,8 @@
   45.89          _this->displays = NULL;
   45.90          _this->num_displays = 0;
   45.91      }
   45.92 -    if (_this->clipboard_text) {
   45.93 -        SDL_free(_this->clipboard_text);
   45.94 -        _this->clipboard_text = NULL;
   45.95 -    }
   45.96 +    SDL_free(_this->clipboard_text);
   45.97 +    _this->clipboard_text = NULL;
   45.98      _this->free(_this);
   45.99      _this = NULL;
  45.100  }
    46.1 --- a/src/video/cocoa/SDL_cocoamodes.m	Thu Aug 29 08:27:25 2013 -0700
    46.2 +++ b/src/video/cocoa/SDL_cocoamodes.m	Thu Aug 29 08:29:21 2013 -0700
    46.3 @@ -281,7 +281,7 @@
    46.4              display.name = (char *)Cocoa_GetDisplayName(displays[i]);
    46.5              if (!GetDisplayMode (_this, moderef, &mode)) {
    46.6                  Cocoa_ReleaseDisplayMode(_this, moderef);
    46.7 -                if (display.name) SDL_free(display.name);
    46.8 +                SDL_free(display.name);
    46.9                  SDL_free(displaydata);
   46.10                  continue;
   46.11              }
   46.12 @@ -290,7 +290,7 @@
   46.13              display.current_mode = mode;
   46.14              display.driverdata = displaydata;
   46.15              SDL_AddVideoDisplay(&display);
   46.16 -            if (display.name) SDL_free(display.name);
   46.17 +            SDL_free(display.name);
   46.18          }
   46.19      }
   46.20      SDL_stack_free(displays);
    47.1 --- a/src/video/cocoa/SDL_cocoavideo.m	Thu Aug 29 08:27:25 2013 -0700
    47.2 +++ b/src/video/cocoa/SDL_cocoavideo.m	Thu Aug 29 08:29:21 2013 -0700
    47.3 @@ -71,9 +71,7 @@
    47.4      }
    47.5      if (!data) {
    47.6          SDL_OutOfMemory();
    47.7 -        if (device) {
    47.8 -            SDL_free(device);
    47.9 -        }
   47.10 +        SDL_free(device);
   47.11          return NULL;
   47.12      }
   47.13      device->driverdata = data;
    48.1 --- a/src/video/directfb/SDL_DirectFB_render.c	Thu Aug 29 08:27:25 2013 -0700
    48.2 +++ b/src/video/directfb/SDL_DirectFB_render.c	Thu Aug 29 08:29:21 2013 -0700
    48.3 @@ -1226,9 +1226,7 @@
    48.4      }
    48.5  #endif
    48.6  
    48.7 -    if (data) {
    48.8 -        SDL_free(data);
    48.9 -    }
   48.10 +    SDL_free(data);
   48.11      SDL_free(renderer);
   48.12  }
   48.13  
    49.1 --- a/src/video/directfb/SDL_DirectFB_video.h	Thu Aug 29 08:27:25 2013 -0700
    49.2 +++ b/src/video/directfb/SDL_DirectFB_video.h	Thu Aug 29 08:29:21 2013 -0700
    49.3 @@ -76,7 +76,7 @@
    49.4  #define DFBENV_USE_WM               "SDL_DIRECTFB_WM"       /* Default: off  */
    49.5  
    49.6  #define SDL_DFB_RELEASE(x) do { if ( (x) != NULL ) { SDL_DFB_CHECK(x->Release(x)); x = NULL; } } while (0)
    49.7 -#define SDL_DFB_FREE(x) do { if ( (x) != NULL ) { SDL_free(x); x = NULL; } } while (0)
    49.8 +#define SDL_DFB_FREE(x) do { SDL_free((x)); (x) = NULL; } while (0)
    49.9  #define SDL_DFB_UNLOCK(x) do { if ( (x) != NULL ) { x->Unlock(x); } } while (0)
   49.10  
   49.11  #define SDL_DFB_CONTEXT "SDL_DirectFB"
    50.1 --- a/src/video/dummy/SDL_nullvideo.c	Thu Aug 29 08:27:25 2013 -0700
    50.2 +++ b/src/video/dummy/SDL_nullvideo.c	Thu Aug 29 08:29:21 2013 -0700
    50.3 @@ -82,9 +82,7 @@
    50.4      device = (SDL_VideoDevice *) SDL_calloc(1, sizeof(SDL_VideoDevice));
    50.5      if (!device) {
    50.6          SDL_OutOfMemory();
    50.7 -        if (device) {
    50.8 -            SDL_free(device);
    50.9 -        }
   50.10 +        SDL_free(device);
   50.11          return (0);
   50.12      }
   50.13  
    51.1 --- a/src/video/uikit/SDL_uikitvideo.m	Thu Aug 29 08:27:25 2013 -0700
    51.2 +++ b/src/video/uikit/SDL_uikitvideo.m	Thu Aug 29 08:29:21 2013 -0700
    51.3 @@ -63,9 +63,7 @@
    51.4      /* Initialize all variables that we clean on shutdown */
    51.5      device = (SDL_VideoDevice *) SDL_calloc(1, sizeof(SDL_VideoDevice));
    51.6      if (!device) {
    51.7 -        if (device) {
    51.8 -            SDL_free(device);
    51.9 -        }
   51.10 +        SDL_free(device);
   51.11          SDL_OutOfMemory();
   51.12          return (0);
   51.13      }
    52.1 --- a/src/video/windows/SDL_windowsmessagebox.c	Thu Aug 29 08:27:25 2013 -0700
    52.2 +++ b/src/video/windows/SDL_windowsmessagebox.c	Thu Aug 29 08:29:21 2013 -0700
    52.3 @@ -233,9 +233,7 @@
    52.4  
    52.5  static void FreeDialogData(WIN_DialogData *dialog)
    52.6  {
    52.7 -    if (dialog->data) {
    52.8 -        SDL_free(dialog->data);
    52.9 -    }
   52.10 +    SDL_free(dialog->data);
   52.11      SDL_free(dialog);
   52.12  }
   52.13  
    53.1 --- a/src/video/windows/SDL_windowsvideo.c	Thu Aug 29 08:27:25 2013 -0700
    53.2 +++ b/src/video/windows/SDL_windowsvideo.c	Thu Aug 29 08:29:21 2013 -0700
    53.3 @@ -75,9 +75,7 @@
    53.4          data = NULL;
    53.5      }
    53.6      if (!data) {
    53.7 -        if (device) {
    53.8 -            SDL_free(device);
    53.9 -        }
   53.10 +        SDL_free(device);
   53.11          SDL_OutOfMemory();
   53.12          return NULL;
   53.13      }
    54.1 --- a/src/video/windows/SDL_windowswindow.c	Thu Aug 29 08:27:25 2013 -0700
    54.2 +++ b/src/video/windows/SDL_windowswindow.c	Thu Aug 29 08:29:21 2013 -0700
    54.3 @@ -319,9 +319,7 @@
    54.4          title = NULL;
    54.5      }
    54.6      SetWindowText(hwnd, title ? title : TEXT(""));
    54.7 -    if (title) {
    54.8 -        SDL_free(title);
    54.9 -    }
   54.10 +    SDL_free(title);
   54.11  }
   54.12  
   54.13  void
    55.1 --- a/src/video/x11/SDL_x11opengl.c	Thu Aug 29 08:27:25 2013 -0700
    55.2 +++ b/src/video/x11/SDL_x11opengl.c	Thu Aug 29 08:29:21 2013 -0700
    55.3 @@ -267,10 +267,8 @@
    55.4  #endif
    55.5  
    55.6      /* Free OpenGL memory */
    55.7 -    if (_this->gl_data) {
    55.8 -        SDL_free(_this->gl_data);
    55.9 -        _this->gl_data = NULL;
   55.10 -    }
   55.11 +    SDL_free(_this->gl_data);
   55.12 +    _this->gl_data = NULL;
   55.13  }
   55.14  
   55.15  static SDL_bool
    56.1 --- a/src/video/x11/SDL_x11video.c	Thu Aug 29 08:27:25 2013 -0700
    56.2 +++ b/src/video/x11/SDL_x11video.c	Thu Aug 29 08:29:21 2013 -0700
    56.3 @@ -565,9 +565,7 @@
    56.4  {
    56.5      SDL_VideoData *data = (SDL_VideoData *) _this->driverdata;
    56.6  
    56.7 -    if (data->classname) {
    56.8 -        SDL_free(data->classname);
    56.9 -    }
   56.10 +    SDL_free(data->classname);
   56.11  #ifdef X_HAVE_UTF8_STRING
   56.12      if (data->im) {
   56.13          XCloseIM(data->im);
    57.1 --- a/test/testautomation.c	Thu Aug 29 08:27:25 2013 -0700
    57.2 +++ b/test/testautomation.c	Thu Aug 29 08:29:21 2013 -0700
    57.3 @@ -113,12 +113,8 @@
    57.4      }
    57.5  
    57.6      /* Clean up */
    57.7 -    if (userRunSeed != NULL) {
    57.8 -        SDL_free(userRunSeed);
    57.9 -    }
   57.10 -    if (filter != NULL) {
   57.11 -        SDL_free(filter);
   57.12 -    }
   57.13 +    SDL_free(userRunSeed);
   57.14 +    SDL_free(filter);
   57.15  
   57.16      /* Shutdown everything */
   57.17      quit(result);
    58.1 --- a/test/testautomation_audio.c	Thu Aug 29 08:27:25 2013 -0700
    58.2 +++ b/test/testautomation_audio.c	Thu Aug 29 08:29:21 2013 -0700
    58.3 @@ -747,11 +747,9 @@
    58.4              SDLTest_AssertCheck(cvt.len_ratio > 0.0, "Verify conversion length ratio; expected: >0; got: %f", cvt.len_ratio);
    58.5  
    58.6              /* Free converted buffer */
    58.7 -            if (cvt.buf != NULL) {
    58.8              SDL_free(cvt.buf);
    58.9              cvt.buf = NULL;
   58.10 -        }
   58.11 -      }
   58.12 +          }
   58.13          }
   58.14        }
   58.15      }
    59.1 --- a/test/testautomation_clipboard.c	Thu Aug 29 08:27:25 2013 -0700
    59.2 +++ b/test/testautomation_clipboard.c	Thu Aug 29 08:29:21 2013 -0700
    59.3 @@ -41,7 +41,7 @@
    59.4      charResult = SDL_GetClipboardText();
    59.5      SDLTest_AssertPass("Call to SDL_GetClipboardText succeeded");
    59.6  
    59.7 -    if (charResult) SDL_free(charResult);
    59.8 +    SDL_free(charResult);
    59.9  
   59.10      return TEST_COMPLETED;
   59.11  }
   59.12 @@ -69,8 +69,8 @@
   59.13          textRef, text);
   59.14  
   59.15      /* Cleanup */
   59.16 -    if (textRef) SDL_free(textRef);
   59.17 -    if (text) SDL_free(text);
   59.18 +    SDL_free(textRef);
   59.19 +    SDL_free(text);
   59.20  
   59.21     return TEST_COMPLETED;
   59.22  }
   59.23 @@ -145,9 +145,9 @@
   59.24          textRef, charResult);
   59.25  
   59.26      /* Cleanup */
   59.27 -    if (textRef) SDL_free(textRef);
   59.28 -    if (text) SDL_free(text);
   59.29 -    if (charResult) SDL_free(charResult);
   59.30 +    SDL_free(textRef);
   59.31 +    SDL_free(text);
   59.32 +    SDL_free(charResult);
   59.33  
   59.34     return TEST_COMPLETED;
   59.35  }
    60.1 --- a/test/testautomation_render.c	Thu Aug 29 08:27:25 2013 -0700
    60.2 +++ b/test/testautomation_render.c	Thu Aug 29 08:29:21 2013 -0700
    60.3 @@ -995,9 +995,7 @@
    60.4     SDLTest_AssertCheck(result == 0, "Validate result from SDLTest_CompareSurfaces, expected: 0, got: %i", result);
    60.5  
    60.6     /* Clean up. */
    60.7 -   if (pixels != NULL) {
    60.8 -       SDL_free(pixels);
    60.9 -   }
   60.10 +   SDL_free(pixels);
   60.11     if (testSurface != NULL) {
   60.12         SDL_FreeSurface(testSurface);
   60.13     }
    61.1 --- a/test/testautomation_video.c	Thu Aug 29 08:27:25 2013 -0700
    61.2 +++ b/test/testautomation_video.c	Thu Aug 29 08:29:21 2013 -0700
    61.3 @@ -1714,10 +1714,10 @@
    61.4    _destroyVideoSuiteTestWindow(window);
    61.5  
    61.6    cleanup:
    61.7 -  if (referenceUserdata != NULL) SDL_free(referenceUserdata);
    61.8 -  if (referenceUserdata2 != NULL) SDL_free(referenceUserdata2);
    61.9 -  if (userdata != NULL) SDL_free(userdata);
   61.10 -  if (userdata2 != NULL) SDL_free(userdata2);
   61.11 +  SDL_free(referenceUserdata);
   61.12 +  SDL_free(referenceUserdata2);
   61.13 +  SDL_free(userdata);
   61.14 +  SDL_free(userdata2);
   61.15  
   61.16    return returnValue;
   61.17  }
    62.1 --- a/test/testiconv.c	Thu Aug 29 08:27:25 2013 -0700
    62.2 +++ b/test/testiconv.c	Thu Aug 29 08:29:21 2013 -0700
    62.3 @@ -75,12 +75,8 @@
    62.4                  SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "FAIL: %s\n", formats[i]);
    62.5                  ++errors;
    62.6              }
    62.7 -            if (test[0]) {
    62.8 -                SDL_free(test[0]);
    62.9 -            }
   62.10 -            if (test[1]) {
   62.11 -                SDL_free(test[1]);
   62.12 -            }
   62.13 +            SDL_free(test[0]);
   62.14 +            SDL_free(test[1]);
   62.15          }
   62.16          test[0] = SDL_iconv_string("UTF-8", "UCS-4", ucs4, len);
   62.17          SDL_free(ucs4);
    63.1 --- a/test/testsprite2.c	Thu Aug 29 08:27:25 2013 -0700
    63.2 +++ b/test/testsprite2.c	Thu Aug 29 08:29:21 2013 -0700
    63.3 @@ -42,15 +42,9 @@
    63.4  static void
    63.5  quit(int rc)
    63.6  {
    63.7 -    if (sprites) {
    63.8 -        SDL_free(sprites);
    63.9 -    }
   63.10 -    if (positions) {
   63.11 -        SDL_free(positions);
   63.12 -    }
   63.13 -    if (velocities) {
   63.14 -        SDL_free(velocities);
   63.15 -    }
   63.16 +    SDL_free(sprites);
   63.17 +    SDL_free(positions);
   63.18 +    SDL_free(velocities);
   63.19      SDLTest_CommonQuit(state);
   63.20      exit(rc);
   63.21  }