Merged r4121:4122 from branches/SDL-1.2: more double-free fixes.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%404362
This commit is contained in:
Ryan C. Gordon 2010-01-06 07:34:20 +00:00
parent 3617a04d58
commit 26e749b7df
2 changed files with 4 additions and 0 deletions

View file

@ -454,6 +454,7 @@ SDL_LoadWAV_RW(SDL_RWops * src, int freesrc,
do {
if (chunk.data != NULL) {
SDL_free(chunk.data);
chunk.data = NULL;
}
lenread = ReadChunk(src, &chunk);
if (lenread < 0) {
@ -553,6 +554,7 @@ SDL_LoadWAV_RW(SDL_RWops * src, int freesrc,
do {
if (*audio_buf != NULL) {
SDL_free(*audio_buf);
*audio_buf = NULL;
}
lenread = ReadChunk(src, &chunk);
if (lenread < 0) {
@ -625,6 +627,7 @@ ReadChunk(SDL_RWops * src, Chunk * chunk)
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);

View file

@ -176,6 +176,7 @@ SDL_StopEventThread(void)
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);