summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEwald Snel <esnel@users.sourceforge.net>2003-02-22 13:20:30 +0000
committerEwald Snel <esnel@users.sourceforge.net>2003-02-22 13:20:30 +0000
commitbd6642e17421911b8e7d24f321e7b012c7a65f1a (patch)
treea99c4eda783392c11d26637f60e8208b7d9045e4 /src
parent4a7f4d7dd12a58ba2d3b0a2e1b3e5371acde72b2 (diff)
downloadxine-lib-bd6642e17421911b8e7d24f321e7b012c7a65f1a.tar.gz
xine-lib-bd6642e17421911b8e7d24f321e7b012c7a65f1a.tar.bz2
Fix memory leak
CVS patchset: 4245 CVS date: 2003/02/22 13:20:30
Diffstat (limited to 'src')
-rw-r--r--src/demuxers/demux_wav.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/demuxers/demux_wav.c b/src/demuxers/demux_wav.c
index b5806fa90..14eb55458 100644
--- a/src/demuxers/demux_wav.c
+++ b/src/demuxers/demux_wav.c
@@ -20,7 +20,7 @@
* MS WAV File Demuxer by Mike Melanson (melanson@pcisys.net)
* based on WAV specs that are available far and wide
*
- * $Id: demux_wav.c,v 1.36 2003/01/23 16:12:15 miguelfreitas Exp $
+ * $Id: demux_wav.c,v 1.37 2003/02/22 13:20:30 esnel Exp $
*
*/
@@ -119,8 +119,10 @@ static int open_wav_file(demux_wav_t *this) {
this->wave = (xine_waveformatex *) malloc( this->wave_size );
if (this->input->read(this->input, (void *)this->wave, this->wave_size) !=
- this->wave_size)
+ this->wave_size) {
+ free (this->wave);
return 0;
+ }
xine_waveformatex_le2me(this->wave);
this->audio_type = formattag_to_buf_audio(this->wave->wFormatTag);
if(!this->audio_type) {
@@ -131,8 +133,10 @@ static int open_wav_file(demux_wav_t *this) {
this->data_start = this->data_size = 0;
while (this->data_start == 0) {
- if (this->input->read(this->input, chunk_preamble, 8) != 8)
+ if (this->input->read(this->input, chunk_preamble, 8) != 8) {
+ free (this->wave);
return 0;
+ }
chunk_tag = LE_32(&chunk_preamble[0]);
chunk_size = LE_32(&chunk_preamble[4]);
@@ -281,6 +285,7 @@ static int demux_wav_seek (demux_plugin_t *this_gen,
static void demux_wav_dispose (demux_plugin_t *this_gen) {
demux_wav_t *this = (demux_wav_t *) this_gen;
+ free(this->wave);
free(this);
}