summaryrefslogtreecommitdiffstats
path: root/libao2/ao_pcm.c
diff options
context:
space:
mode:
authorarpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2>2003-01-29 12:22:00 +0000
committerarpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2>2003-01-29 12:22:00 +0000
commit2b8643963c888deb979ae5ad3e052208f21c8628 (patch)
treee2c7cbf79e4a8687037755c5832fbfdcbe2e2f4d /libao2/ao_pcm.c
parentee79e97c5eb4086aba5bb432ad95948ad7af90d8 (diff)
downloadmpv-2b8643963c888deb979ae5ad3e052208f21c8628.tar.bz2
mpv-2b8643963c888deb979ae5ad3e052208f21c8628.tar.xz
double free(), found by Olivier Galibert <galibert@pobox.com>
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@9157 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libao2/ao_pcm.c')
-rw-r--r--libao2/ao_pcm.c5
1 files changed, 1 insertions, 4 deletions
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)