Commit 26e749b7 authored by Ryan C. Gordon's avatar Ryan C. Gordon

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

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%404362
parent 3617a04d
......@@ -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);
......
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment