mux: plug some memory leaks on error

Make sure chunk->data and wpi are not leaked by
MuxAddFrameTileInternal() in case of MEMORY_ERROR in ChunkSetNth().

Change-Id: Ie20e84b92f4bdcb7c3b94520f36b20dd2e730545
This commit is contained in:
Urvang Joshi
2012-01-17 05:41:56 +00:00
committed by James Zern
parent 241ddd38e2
commit b0d2fecf25
3 changed files with 28 additions and 12 deletions

View File

@@ -47,8 +47,7 @@ void ChunkInit(WebPChunk* const chunk) {
chunk->next_ = NULL;
}
// Releases chunk and returns chunk->next_.
static WebPChunk* ChunkRelease(WebPChunk* const chunk) {
WebPChunk* ChunkRelease(WebPChunk* const chunk) {
WebPChunk* next;
if (chunk == NULL) return NULL;
free(chunk->image_info_);
@@ -239,7 +238,7 @@ void MuxImageInit(WebPMuxImage* const wpi) {
wpi->next_ = NULL;
}
static WebPMuxImage* MuxImageRelease(WebPMuxImage* const wpi) {
WebPMuxImage* MuxImageRelease(WebPMuxImage* const wpi) {
WebPMuxImage* next;
if (wpi == NULL) return NULL;
ChunkDelete(wpi->header_);