mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-10-13 21:35:59 +00:00
Christoph Mallon: Remove pointless if (x) before SDL_free(x)
This commit is contained in:
@@ -449,10 +449,8 @@ SDL_LoadWAV_RW(SDL_RWops * src, int freesrc,
|
||||
/* 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 @@ SDL_LoadWAV_RW(SDL_RWops * src, int freesrc,
|
||||
/* 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 @@ SDL_LoadWAV_RW(SDL_RWops * src, int freesrc,
|
||||
*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 @@ SDL_LoadWAV_RW(SDL_RWops * src, int freesrc,
|
||||
void
|
||||
SDL_FreeWAV(Uint8 * audio_buf)
|
||||
{
|
||||
if (audio_buf != NULL) {
|
||||
SDL_free(audio_buf);
|
||||
}
|
||||
SDL_free(audio_buf);
|
||||
}
|
||||
|
||||
static int
|
||||
|
Reference in New Issue
Block a user