Changeset 5295:5914c84e72be in roaraudio for libroar


Ignore:
Timestamp:
11/24/11 19:43:11 (12 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

converted message (protocol) rutunes to use roar_mm_*() (Closes: #129)

Location:
libroar
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • libroar/auth.c

    r5158 r5295  
    145145 
    146146 if ( mes.datalen > sizeof(mes.data) ) { 
    147   data = malloc(mes.datalen); 
     147  data = roar_mm_malloc(mes.datalen); 
    148148  if ( data == NULL ) 
    149149   return -1; 
     
    208208 
    209209 if ( data != NULL ) 
    210   free(data); 
     210  roar_mm_free(data); 
    211211 
    212212 ROAR_DBG("roar_auth_ask_server(con=%p, authmes=%p) = %i // next: %i", con, authmes, ret, authmes->type); 
     
    418418 
    419419 if ( (ames->len + 4) > sizeof(mes->data) ) { 
    420   *data = malloc(ames->len + 4); 
     420  *data = roar_mm_malloc(ames->len + 4); 
    421421  if ( *data == NULL ) 
    422422   return -1; 
  • libroar/caps.c

    r5149 r5295  
    5757   return -1; 
    5858 
    59   if ( (*data = malloc(needlen)) == NULL ) 
     59  if ( (*data = roar_mm_malloc(needlen)) == NULL ) 
    6060   return -1; 
    6161 
     
    179179 if ( mes.cmd != ROAR_CMD_OK ) { 
    180180  if ( data != NULL ) 
    181    free(data); 
     181   roar_mm_free(data); 
    182182  return -1; 
    183183 } 
     
    185185 if ( roar_caps_from_msg(&caps, &mes, data) == -1 ) { 
    186186  if ( data != NULL ) 
    187    free(data); 
     187   roar_mm_free(data); 
    188188  return -1; 
    189189 } 
     
    192192 if ( caps.version != 0 || caps.type != ROAR_CT_STANDARDS || (caps.len & 0x3) != 0 ) { 
    193193  if ( data != NULL ) 
    194    free(data); 
     194   roar_mm_free(data); 
    195195  return -1; 
    196196 } 
     
    200200  if ( *out == NULL ) { 
    201201   if ( data != NULL ) 
    202     free(data); 
     202    roar_mm_free(data); 
    203203   return -1; 
    204204  } 
     
    213213 
    214214 if ( data != NULL ) 
    215   free(data); 
     215  roar_mm_free(data); 
    216216 
    217217 return 0; 
  • libroar/error.c

    r5286 r5295  
    100100 
    101101  roar_err_clear_errno(); 
    102   *data = malloc(datalen); 
     102  *data = roar_mm_malloc(datalen); 
    103103  roar_err_from_errno(); 
    104104  if ( *data == NULL ) 
  • libroar/ltm.c

    r5270 r5295  
    137137 
    138138 if ( buf != NULL ) 
    139   free(buf); 
     139  roar_mm_free(buf); 
    140140 
    141141 if ( ret != -1 ) { 
     
    194194 if ( ret == -1 || mes.cmd != ROAR_CMD_OK ) { 
    195195  if ( buf != NULL ) 
    196    free(buf); 
     196   roar_mm_free(buf); 
    197197  return NULL; 
    198198 } 
     
    228228 if ( res == NULL ) { 
    229229  if ( buf != NULL ) 
    230    free(buf); 
     230   roar_mm_free(buf); 
    231231  return NULL; 
    232232 } 
     
    243243 
    244244 if ( buf != NULL ) 
    245   free(buf); 
     245  roar_mm_free(buf); 
    246246 return res; 
    247247} 
  • libroar/meta.c

    r5270 r5295  
    507507  return -1; 
    508508 
    509  if ( (c = malloc(((unsigned) m.data[1]) + 1)) == NULL ) 
     509 if ( (c = roar_mm_malloc(((unsigned) m.data[1]) + 1)) == NULL ) 
    510510  return -1; 
    511511 
     
    555555int roar_meta_free (struct roar_meta * meta) { 
    556556 if ( meta->value ) 
    557   free(meta->value); 
     557  roar_mm_free(meta->value); 
    558558 
    559559 return 0; 
  • libroar/proto.c

    r5270 r5295  
    272272  } 
    273273 
    274   if ( (*data = malloc(mes->datalen)) == NULL ) { 
     274  if ( (*data = roar_mm_malloc(mes->datalen)) == NULL ) { 
    275275   roar_err_set(ROAR_ERROR_NOMEM); 
    276276   return -1; 
     
    330330 
    331331 if ( data != NULL ) 
    332   free(*data); 
     332  roar_mm_free(*data); 
    333333 
    334334 roar_vio_sync(vio); // we need to do this becasue of ssl/compressed links 
  • libroar/serverinfo.c

    r5279 r5295  
    6666 
    6767 if ( data != NULL ) 
    68   free(data); 
     68  roar_mm_free(data); 
    6969 
    7070 return ret; 
     
    113113   return -1; 
    114114 
    115   mesdata = malloc(needlen); 
     115  mesdata = roar_mm_malloc(needlen); 
    116116 
    117117  if ( mesdata == NULL ) 
  • libroar/vs.c

    r5289 r5295  
    213213 
    214214 if ( data != NULL ) 
    215   free(data); 
     215  roar_mm_free(data); 
    216216 
    217217 return 0; 
Note: See TracChangeset for help on using the changeset viewer.