#include <vlc_common.h>
#include "libvlc.h"
+#include <assert.h>
#include <stdlib.h> /* free(), strtol() */
#include <stdio.h> /* sprintf() */
#include <string.h> /* strdup() */
}
if( i_cache )
+ {
pp_cache = p_bank->pp_loaded_cache =
malloc( i_cache * sizeof(void *) );
+ assert( pp_cache );
+ }
#define LOAD_IMMEDIATE(a) \
if( fread( (void *)&a, sizeof(char), sizeof(a), file ) != sizeof(a) ) goto error
int i_submodules;
pp_cache[i] = malloc( sizeof(module_cache_t) );
+ assert( pp_cache[i] );
p_bank->i_loaded_cache++;
/* Load common info */
{
p_module->p_config[i].ppf_action =
malloc( p_module->p_config[i].i_action * sizeof(void *) );
+ assert( p_module->p_config[i].ppf_action );
p_module->p_config[i].ppsz_action_text =
malloc( p_module->p_config[i].i_action * sizeof(char *) );
+ assert( p_module->p_config[i].ppsz_action_text );
for (int j = 0; j < p_module->p_config[i].i_action; j++)
{
httpd_file_sys_t *p_sys )
{
httpd_file_t *file = malloc( sizeof( httpd_file_t ) );
+ assert( file );
if( ( file->url = httpd_UrlNewUnique( host, psz_url, psz_user,
psz_password, p_acl )
answer->i_body = sizeof("HTTP/1.0 xxx \r\n")
+ strlen(psz_status) + i_headers - 1;
psz_new = (char *)malloc( answer->i_body + 1);
+ assert( psz_new );
sprintf( psz_new, "HTTP/1.0 %03d %s\r\n", i_status, psz_status );
memcpy( &psz_new[strlen(psz_new)], psz_headers, i_headers );
free( answer->p_body );
httpd_handler_sys_t *p_sys )
{
httpd_handler_t *handler = malloc( sizeof( httpd_handler_t ) );
+ assert( handler );
if( ( handler->url = httpd_UrlNewUnique( host, psz_url, psz_user,
psz_password, p_acl )
const char *psz_url_src )
{
httpd_redirect_t *rdir = malloc( sizeof( httpd_redirect_t ) );
+ assert( rdir );
if( !( rdir->url = httpd_UrlNewUnique( host, psz_url_src, NULL, NULL, NULL ) ) )
{
answer->i_body = i_write;
answer->p_body = malloc( i_write );
+ assert( answer->p_body );
memcpy( answer->p_body, &stream->p_buffer[i_pos], i_write );
answer->i_body_offset += i_write;
{
answer->i_body = stream->i_header;
answer->p_body = malloc( stream->i_header );
+ assert( answer->p_body );
memcpy( answer->p_body, stream->p_header, stream->i_header );
}
answer->i_body_offset = stream->i_buffer_last_pos;
const vlc_acl_t *p_acl )
{
httpd_stream_t *stream = malloc( sizeof( httpd_stream_t ) );
+ assert( stream );
if( ( stream->url = httpd_UrlNewUnique( host, psz_url, psz_user,
psz_password, p_acl )
stream->p_header = NULL;
stream->i_buffer_size = 5000000; /* 5 Mo per stream */
stream->p_buffer = malloc( stream->i_buffer_size );
+ assert( stream->p_buffer );
/* We set to 1 to make life simpler
* (this way i_body_offset can never be 0) */
stream->i_buffer_pos = 1;
if( i_data > 0 )
{
stream->p_header = malloc( i_data );
+ assert( stream->p_header );
memcpy( stream->p_header, p_data, i_data );
}
vlc_mutex_unlock( &stream->lock );
}
url = malloc( sizeof( httpd_url_t ) );
+ assert( url );
url->host = host;
vlc_mutex_init( &url->lock );
cl->i_buffer_size = HTTPD_CL_BUFSIZE;
cl->i_buffer = 0;
cl->p_buffer = malloc( cl->i_buffer_size );
+ assert( cl->p_buffer );
cl->i_mode = HTTPD_CLIENT_FILE;
cl->b_read_waiting = false;
cl->query.i_channel = cl->p_buffer[1];
cl->query.i_body = (cl->p_buffer[2] << 8)|cl->p_buffer[3];
cl->query.p_body = malloc( cl->query.i_body );
+ assert( cl->query.p_body );
cl->i_buffer -= 4;
memcpy( cl->query.p_body, cl->p_buffer + 4, cl->i_buffer );
}
* request and close the connection
* to mark and of body (probably only RTSP) */
cl->query.p_body = malloc( cl->query.i_body );
+ assert( cl->query.p_body );
cl->i_buffer = 0;
}
else
cl->i_buffer_size = i_size;
free( cl->p_buffer );
cl->p_buffer = malloc( i_size );
+ assert( cl->p_buffer );
}
p = (char *)cl->p_buffer;
cl->i_buffer_size = 1000;
free( cl->p_buffer );
cl->p_buffer = malloc( cl->i_buffer_size );
+ assert( cl->p_buffer );
cl->i_state = HTTPD_CLIENT_RECEIVING;
}
else
cl->i_buffer_size = 1000;
free( cl->p_buffer );
cl->p_buffer = malloc( cl->i_buffer_size );
+ assert( cl->p_buffer );
cl->i_state = HTTPD_CLIENT_RECEIVING;
cl->b_read_waiting = false;
}