Skip to content

Commit

Permalink
Prevent a double-free
Browse files Browse the repository at this point in the history
  • Loading branch information
alexcrichton committed Jun 15, 2012
1 parent df4dc3c commit 56d4bf5
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions AudioStreamer/AudioStreamer.m
Original file line number Diff line number Diff line change
Expand Up @@ -631,8 +631,14 @@ - (void) stop {
assert(!err);
audioQueue = nil;
}
if (buffers != NULL) free(buffers);
if (inuse != NULL) free(inuse);
if (buffers != NULL) {
free(buffers);
buffers = NULL;
}
if (inuse != NULL) {
free(inuse);
inuse = NULL;
}

httpHeaders = nil;
bytesFilled = 0;
Expand Down

0 comments on commit 56d4bf5

Please sign in to comment.