src/audio/SDL_wave.c
changeset 7719 31b5f9ff36ca
parent 7678 286c42d7c5ed
child 8093 b43765095a6f
     1.1 --- a/src/audio/SDL_wave.c	Thu Aug 29 08:27:25 2013 -0700
     1.2 +++ b/src/audio/SDL_wave.c	Thu Aug 29 08:29:21 2013 -0700
     1.3 @@ -449,10 +449,8 @@
     1.4      /* Read the audio data format chunk */
     1.5      chunk.data = NULL;
     1.6      do {
     1.7 -        if (chunk.data != NULL) {
     1.8 -            SDL_free(chunk.data);
     1.9 -            chunk.data = NULL;
    1.10 -        }
    1.11 +        SDL_free(chunk.data);
    1.12 +        chunk.data = NULL;
    1.13          lenread = ReadChunk(src, &chunk);
    1.14          if (lenread < 0) {
    1.15              was_error = 1;
    1.16 @@ -549,10 +547,8 @@
    1.17      /* Read the audio data chunk */
    1.18      *audio_buf = NULL;
    1.19      do {
    1.20 -        if (*audio_buf != NULL) {
    1.21 -            SDL_free(*audio_buf);
    1.22 -            *audio_buf = NULL;
    1.23 -        }
    1.24 +        SDL_free(*audio_buf);
    1.25 +        *audio_buf = NULL;
    1.26          lenread = ReadChunk(src, &chunk);
    1.27          if (lenread < 0) {
    1.28              was_error = 1;
    1.29 @@ -583,9 +579,7 @@
    1.30      *audio_len &= ~(samplesize - 1);
    1.31  
    1.32    done:
    1.33 -    if (format != NULL) {
    1.34 -        SDL_free(format);
    1.35 -    }
    1.36 +    SDL_free(format);
    1.37      if (src) {
    1.38          if (freesrc) {
    1.39              SDL_RWclose(src);
    1.40 @@ -606,9 +600,7 @@
    1.41  void
    1.42  SDL_FreeWAV(Uint8 * audio_buf)
    1.43  {
    1.44 -    if (audio_buf != NULL) {
    1.45 -        SDL_free(audio_buf);
    1.46 -    }
    1.47 +    SDL_free(audio_buf);
    1.48  }
    1.49  
    1.50  static int