Changeset 3063:955233719a84 in roaraudio for roard


Ignore:
Timestamp:
12/26/09 20:36:31 (14 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

use memory functions from libroar, not libc, fixed a small memory leak

Location:
roard
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • roard/clients.c

    r2828 r3063  
    5151 for (i = 0; i < ROAR_CLIENTS_MAX; i++) { 
    5252  if ( g_clients[i] == NULL ) { 
    53    n = malloc(sizeof(struct roar_client)); 
     53   n = roar_mm_malloc(sizeof(struct roar_client)); 
    5454   if ( n != NULL ) { 
    5555    n->pid    = -1; 
     
    7171 
    7272    if ( roar_nnode_new(&(n->nnode), ROAR_SOCKET_TYPE_UNKNOWN) == -1 ) { 
    73      free(n); 
     73     roar_mm_free(n); 
    7474     return -1; 
    7575    } 
     
    114114 roar_nnode_free(&(g_clients[id]->nnode)); 
    115115 
    116  free(g_clients[id]); 
     116 roar_mm_free(g_clients[id]); 
    117117 g_clients[id] = NULL; 
    118118 
  • roard/streams.c

    r3042 r3063  
    6868 for (i = 0; i < ROAR_STREAMS_MAX; i++) { 
    6969  if ( g_streams[i] == NULL ) { 
    70    s = ROAR_STREAM_SERVER(n = ROAR_STREAM(malloc(sizeof(struct roar_stream_server)))); 
     70   s = ROAR_STREAM_SERVER(n = ROAR_STREAM(roar_mm_malloc(sizeof(struct roar_stream_server)))); 
    7171   if ( n == NULL ) { 
    7272    ROAR_ERR("streams_new(void): can not allocate memory for new stream: %s", strerror(errno)); 
     
    252252  free(s->name); 
    253253 
    254  free(s); 
     254 roar_mm_free(s); 
    255255 
    256256 g_streams[id] = NULL; 
Note: See TracChangeset for help on using the changeset viewer.