# HG changeset patch # User Ryan C. Gordon # Date 1262763260 0 # Node ID 57823d017f026a97eb8b42268a8aba1a65c18892 # Parent 3c1b39d0d1a61c07e2e4f1c41199b98e80afa1bc Merged r4121:4122 from branches/SDL-1.2: more double-free fixes. diff -r 3c1b39d0d1a6 -r 57823d017f02 src/audio/SDL_wave.c --- a/src/audio/SDL_wave.c Wed Jan 06 07:26:49 2010 +0000 +++ b/src/audio/SDL_wave.c Wed Jan 06 07:34:20 2010 +0000 @@ -454,6 +454,7 @@ do { if (chunk.data != NULL) { SDL_free(chunk.data); + chunk.data = NULL; } lenread = ReadChunk(src, &chunk); if (lenread < 0) { @@ -553,6 +554,7 @@ do { if (*audio_buf != NULL) { SDL_free(*audio_buf); + *audio_buf = NULL; } lenread = ReadChunk(src, &chunk); if (lenread < 0) { @@ -625,6 +627,7 @@ if (SDL_RWread(src, chunk->data, chunk->length, 1) != 1) { SDL_Error(SDL_EFREAD); SDL_free(chunk->data); + chunk->data = NULL; return (-1); } return (chunk->length); diff -r 3c1b39d0d1a6 -r 57823d017f02 src/events/SDL_events.c --- a/src/events/SDL_events.c Wed Jan 06 07:26:49 2010 +0000 +++ b/src/events/SDL_events.c Wed Jan 06 07:34:20 2010 +0000 @@ -176,6 +176,7 @@ SDL_WaitThread(SDL_EventThread, NULL); SDL_EventThread = NULL; SDL_DestroyMutex(SDL_EventLock.lock); + SDL_EventLock.lock = NULL; } if (SDL_EventQ.lock) { SDL_DestroyMutex(SDL_EventQ.lock);