Changeset 4014:2fee6bf2dc0c in roaraudio for roarclients/roardtmf.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/roardtmf.c

    r3517 r4014  
    170170*/ 
    171171 
    172  if ( (buf = malloc((len = bits*samples/8))) == NULL ) 
     172 if ( (buf = roar_mm_malloc((len = bits*samples/8))) == NULL ) 
    173173  return 4; 
    174174 
    175175 if ( roar_vio_simple_stream(&stream, rate, 1, bits, codec, server, ROAR_DIR_PLAY, name) == -1 ) { 
    176176  fprintf(stderr, "Error: can not start playback\n"); 
     177  roar_mm_free(buf); 
    177178  return 1; 
    178179 } 
     
    184185   continue; 
    185186 
    186   if ( calc(buf, len, rate, c) == -1 ) 
     187  if ( calc(buf, len, rate, c) == -1 ) { 
     188   roar_mm_free(buf); 
    187189   return 5; 
     190  } 
    188191  roar_vio_write(&stream, buf, len); 
    189192 } 
    190193 
    191194 roar_vio_close(&stream); 
     195 
     196 roar_mm_free(buf); 
    192197 
    193198 return 0; 
Note: See TracChangeset for help on using the changeset viewer.