From 2b8643963c888deb979ae5ad3e052208f21c8628 Mon Sep 17 00:00:00 2001 From: arpi Date: Wed, 29 Jan 2003 12:22:00 +0000 Subject: double free(), found by Olivier Galibert git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@9157 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libao2/ao_pcm.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'libao2/ao_pcm.c') diff --git a/libao2/ao_pcm.c b/libao2/ao_pcm.c index dda741bd79..a598d705e8 100644 --- a/libao2/ao_pcm.c +++ b/libao2/ao_pcm.c @@ -77,9 +77,7 @@ static int control(int cmd,int arg){ static int init(int rate,int channels,int format,int flags){ int bits; if(!ao_outputfilename) { - ao_outputfilename = (char *) malloc(sizeof(char) * 14); - strcpy(ao_outputfilename, - (ao_pcm_waveheader ? "audiodump.wav" : "audiodump.pcm")); + ao_outputfilename = strdup(ao_pcm_waveheader ? "audiodump.wav" : "audiodump.pcm"); } /* bits is only equal to format if (format == 8) or (format == 16); @@ -138,7 +136,6 @@ static void uninit(){ fwrite(&wavhdr,sizeof(wavhdr),1,fp); } fclose(fp); - free(ao_outputfilename); } // stop playing and empty buffers (for seeking/pause) -- cgit v1.2.3