Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Merged r4121:4122 from branches/SDL-1.2: more double-free fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed Jan 6, 2010
1 parent 152941f commit 6f63a0e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/audio/SDL_wave.c
Expand Up @@ -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) {
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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);
Expand Down
1 change: 1 addition & 0 deletions src/events/SDL_events.c
Expand Up @@ -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);
Expand Down

0 comments on commit 6f63a0e

Please sign in to comment.