From: Andre Noll Date: Thu, 13 Sep 2007 19:53:32 +0000 (+0200) Subject: ogg_afh.c: Fix a memory leak. X-Git-Tag: v0.3.0~421 X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=commitdiff_plain;h=6a61fb8d6127ba4f45cc9b80625b1798ff4d3b4e;hp=727ae07c46980a5115f9085bee6c72ef3109c8bb ogg_afh.c: Fix a memory leak. In an non-ogg file is passed to the ogg audio format handler, such that the initial ogg_sync_pageout() fails, the old code leaked the memory which was allocated for the stream_in and the stream_out pointers. --- diff --git a/ogg_afh.c b/ogg_afh.c index 1c0c6323..ef7d4f75 100644 --- a/ogg_afh.c +++ b/ogg_afh.c @@ -133,8 +133,11 @@ static int ogg_compute_header_len(char *map, size_t numbytes, memcpy(buf, map, len); ogg_sync_wrote(sync_in, (long)len); ret = -E_SYNC_PAGEOUT; - if (ogg_sync_pageout(sync_in, &page) <= 0) + if (ogg_sync_pageout(sync_in, &page) <= 0) { + free(stream_in); + free(stream_out); goto err1; + } serial = ogg_page_serialno(&page); ogg_stream_init(stream_in, serial); ogg_stream_init(stream_out, serial);