caf.c : Fix a memory leak.

This commit is contained in:
Erik de Castro Lopo 2005-10-28 15:46:35 +00:00
parent eebaf47a13
commit 2814d19a12
2 changed files with 3 additions and 7 deletions

View File

@ -5,6 +5,9 @@
--enable-experimental was enabled. When OGG does finally work it will be
merged.
* src/caf.c
Fix a memory leak.
2005-10-27 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
* src/g72x.c src/G72x/*.(c|h) src/common.h src/sndfile.c src/wav.c src/au.c

View File

@ -128,13 +128,6 @@ caf_open (SF_PRIVATE *psf)
** By default, add the peak chunk to floating point files. Default behaviour
** can be switched off using sf_command (SFC_SET_PEAK_CHUNK, SF_FALSE).
*/
if (psf->mode == SFM_WRITE && (subformat == SF_FORMAT_FLOAT || subformat == SF_FORMAT_DOUBLE))
{ psf->peak_info = calloc (1, 2 * sizeof (int) * psf->sf.channels * sizeof (PEAK_POS)) ;
if (psf->peak_info == NULL)
return SFE_MALLOC_FAILED ;
psf->peak_info->peak_loc = SF_PEAK_START ;
} ;
if (psf->mode == SFM_WRITE && (subformat == SF_FORMAT_FLOAT || subformat == SF_FORMAT_DOUBLE))
{ if ((psf->peak_info = peak_info_calloc (psf->sf.channels)) == NULL)
return SFE_MALLOC_FAILED ;