Changeset 4014:2fee6bf2dc0c in roaraudio for roarclients/roarfctest.c


Ignore:
Timestamp:
07/01/10 20:04:36 (14 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

fixed some resurce leaks

File:
1 edited

Legend:

Unmodified
Added
Removed
  • roarclients/roarfctest.c

    r3812 r4014  
    102102#endif 
    103103 
    104  if ( roar_stream_new(stream, rate, channels, bits, codec) == -1 ) 
     104 if ( roar_stream_new(stream, rate, channels, bits, codec) == -1 ) { 
     105  pclose(rmsout); 
    105106  return 2; 
     107 } 
    106108 
    107109 if ( roardsp_filter_init(filt, stream, ROARDSP_FILTER_DCBLOCK) == -1 ) { 
    108110  ROAR_ERR("main(*): roardsp_filter_init() failed: errno=%s(%i)", strerror(errno), errno); 
     111  pclose(rmsout); 
    109112  return 1; 
    110113 } 
     
    117120 if ( roardsp_filter_init(filt+1, stream, ROARDSP_FILTER_HIGHP) == -1 ) { 
    118121  ROAR_ERR("main(*): roardsp_filter_init() failed: errno=%s(%i)", strerror(errno), errno); 
     122  pclose(rmsout); 
    119123  return 1; 
    120124 } 
     
    125129 if ( roardsp_filter_init(filt+2, stream, ROARDSP_FILTER_AMP) == -1 ) { 
    126130  ROAR_ERR("main(*): roardsp_filter_init() failed: errno=%s(%i)", strerror(errno), errno); 
     131  pclose(rmsout); 
    127132  return 1; 
    128133 } 
     
    211216 
    212217 if ( rmsout != NULL ) 
    213   fclose(rmsout); 
     218  pclose(rmsout); 
    214219 
    215220 return 0; 
Note: See TracChangeset for help on using the changeset viewer.