Changeset 3063:955233719a84 in roaraudio for libroar


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:
libroar
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • libroar/stack.c

    r1284 r3063  
    4848 
    4949struct roar_stack * roar_stack_newalloc(void) { 
    50  struct roar_stack * stack = malloc(sizeof(struct roar_stack)); 
     50 struct roar_stack * stack = roar_mm_malloc(sizeof(struct roar_stack)); 
    5151 
    5252 if ( stack == NULL ) 
  • libroar/vio_cmd.c

    r1663 r3063  
    4646  return -1; 
    4747 
    48  if ( (state = malloc(sizeof(struct roar_vio_cmd_state))) == NULL ) 
     48 if ( (state = roar_mm_malloc(sizeof(struct roar_vio_cmd_state))) == NULL ) 
    4949  return -1; 
    5050 
     
    132132 
    133133// state->state = ROAR_VIO_CMD_STATE_CLOSED; 
    134  free(state); 
     134 roar_mm_free(state); 
    135135 
    136136 return 0; 
     
    226226  return -1; 
    227227 
    228  if ( (state = malloc(sizeof(struct roar_vio_2popen_state))) == NULL ) 
     228 if ( (state = roar_mm_malloc(sizeof(struct roar_vio_2popen_state))) == NULL ) 
    229229  return -1; 
    230230 
     
    282282  free(state->child.cmd); 
    283283 
    284  free(state); 
     284 roar_mm_free(state); 
    285285 
    286286 return 0; 
  • libroar/vio_pipe.c

    r1505 r3063  
    4343  return -1; 
    4444 
    45  if ( (self = malloc(sizeof(struct roar_vio_pipe))) == NULL ) 
     45 if ( (self = roar_mm_malloc(sizeof(struct roar_vio_pipe))) == NULL ) 
    4646  return -1; 
    4747 
     
    6565    // no buffers need to be set up here, 
    6666    // we handle the NULL pointer in the reader and writer func 
    67     free(self); 
     67    roar_mm_free(self); 
    6868    return -1; 
    6969   break; 
     
    7373    if ( rw == O_RDWR || rw == O_RDONLY ) 
    7474     if ( pipe(self->b.p) == -1 ) { 
    75       free(self); 
     75      roar_mm_free(self); 
    7676      return -1; 
    7777     } 
     
    8080      close(self->b.p[0]); 
    8181      close(self->b.p[1]); 
    82       free(self); 
     82      roar_mm_free(self); 
    8383      return -1; 
    8484     } 
     
    8686  case ROAR_VIO_PIPE_TYPE_SOCKET: 
    8787    if ( socketpair(AF_UNIX, SOCK_STREAM, 0, self->b.p) == -1 ) { 
    88      free(self); 
     88     roar_mm_free(self); 
    8989     return -1; 
    9090    } 
     
    9999   break; 
    100100  default: 
    101     free(self); 
     101    roar_mm_free(self); 
    102102    return -1; 
    103103 } 
     
    175175 
    176176 if ( ! self->refcount ) { 
    177   free(self); 
     177  roar_mm_free(self); 
    178178 } 
    179179 
  • libroar/vio_stack.c

    r1505 r3063  
    4141  return -1; 
    4242 
    43  if ( (self = malloc(sizeof(struct roar_vio_stack))) == NULL ) 
     43 if ( (self = roar_mm_malloc(sizeof(struct roar_vio_stack))) == NULL ) 
    4444  return -1; 
    4545 
     
    9494 } 
    9595 
    96  free(self); 
     96 roar_mm_free(self); 
    9797 
    9898 return 0; 
Note: See TracChangeset for help on using the changeset viewer.