# include "config.h"
#endif
+#include <assert.h>
+
#include "http.h"
#include "macros.h"
#include <vlc_url.h>
+#include <vlc_memory.h>
static int MacroParse( macro_t *m, char *psz_src )
{
{ \
int __i__ = *pp_dst - *pp_data; \
*pi_data += (l); \
- *pp_data = realloc( *pp_data, *pi_data ); \
+ *pp_data = realloc_or_free( *pp_data, *pi_data ); \
+ assert( *pp_data ); \
*pp_dst = (*pp_data) + __i__; \
}
#define PRINT( str ) \
if( !*item ) continue;
int i_item = atoi( item );
- p_items = realloc( p_items, (i_nb_items + 1) *
- sizeof(*p_items) );
+ p_items = realloc_or_free( p_items,
+ (i_nb_items + 1) * sizeof(*p_items) );
+ assert( p_items );
p_items[i_nb_items] = i_item;
i_nb_items++;
}
if( !*item ) continue;
int i_item = atoi( item );
- p_items = realloc( p_items, (i_nb_items + 1) *
- sizeof(*p_items) );
+ p_items = realloc_or_free( p_items,
+ (i_nb_items + 1) * sizeof(*p_items) );
+ assert( p_items );
p_items[i_nb_items] = i_item;
i_nb_items++;
}
char *vlm_error;
int i;
+ assert( psz );
+
if( p_intf->p_sys->p_vlm == NULL )
p_intf->p_sys->p_vlm = vlm_New( p_intf );
src = dup = malloc( _end - _src + 1 );
end = src +( _end - _src );
+ assert( src );
+
memcpy( src, _src, _end - _src );
*end = '\0';
int i_index = dst - *pp_data;
*pi_data += i_copy;
- *pp_data = realloc( *pp_data, *pi_data );
+ *pp_data = realloc_or_free( *pp_data, *pi_data );
+ assert( *pp_data );
dst = (*pp_data) + i_index;
memcpy( dst, src, i_copy );