Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

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

  • Loading branch information
icculus committed Jan 6, 2010
1 parent 152941f commit 6f63a0e1691acb05c2a21c6fdaca3d45b1ca56df
Showing with 4 additions and 0 deletions.
  1. +3 −0 src/audio/SDL_wave.c
  2. +1 −0 src/events/SDL_events.c
@@ -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);

0 comments on commit 6f63a0e

Please sign in to comment.