Changeset 5295:5914c84e72be in roaraudio


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)

Files:
13 edited

Legend:

Unmodified
Added
Removed
  • ChangeLog

    r5292 r5295  
    11v. 1.0beta0 - ? 
    2         * Updated API (SONAME change) (Closes: #184, #185, #128, #135, #134, #133) 
     2        * Updated API (SONAME change) (Closes: #184, #185, #128, #135, #134, #133, #129) 
    33        * Do not set errno to zero in ogg_vorbis codec filter (Closes: #191) 
    44        * Updated data types for struct roar_audio_info (Closes: #189) 
  • 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; 
  • roard/clients.c

    r5275 r5295  
    654654 
    655655 if ( data != NULL ) 
    656   free(data); 
     656  roar_mm_free(data); 
    657657 
    658658 ROAR_DBG("clients_check(id=%i) = %i", id, rv); 
  • roard/meta.c

    r5162 r5295  
    4141   s->meta[i].type = ROAR_META_TYPE_NONE; 
    4242   if ( s->meta[i].value != NULL ) 
    43     free(s->meta[i].value); 
     43    roar_mm_free(s->meta[i].value); 
    4444   s->meta[i].value = NULL; 
    4545  } 
     
    164164  s->meta[i].type   = ROAR_META_TYPE_NONE; 
    165165  if ( s->meta[i].value ) 
    166    free(s->meta[i].value); 
     166   roar_mm_free(s->meta[i].value); 
    167167  s->meta[i].value  = NULL; 
    168168  s->meta[i].key[0] = 0; 
  • roard/output.c

    r5242 r5295  
    201201#ifdef ROAR_DRIVER_CODEC 
    202202  if ( opts == NULL ) { 
    203    opts = to_free = strdup("codec=" ROAR_DRIVER_CODEC); 
     203   opts = to_free = roar_mm_strdup("codec=" ROAR_DRIVER_CODEC); 
    204204  } 
    205205#endif 
     
    371371#ifdef ROAR_DRIVER_CODEC 
    372372   if ( to_free != NULL ) 
    373     free(to_free); 
     373    roar_mm_free(to_free); 
    374374#endif 
    375375   return -1; 
     
    439439#ifdef ROAR_DRIVER_CODEC 
    440440 if ( to_free != NULL ) 
    441   free(to_free); 
     441  roar_mm_free(to_free); 
    442442#endif 
    443443 
  • roard/req.c

    r5279 r5295  
    5959 
    6060 if ( *data != NULL ) 
    61   free(*data); 
    62  
    63  *data = malloc(len); 
     61  roar_mm_free(*data); 
     62 
     63 *data = roar_mm_malloc(len); 
    6464 
    6565 ROAR_DBG("_dataspace(mes=%p, data=%p, flags=%p, len=%llu): *data=%p", mes, data, flags, (long long unsigned int)len, *data); 
Note: See TracChangeset for help on using the changeset viewer.