Fix a potential segfault.
#ifdef USE_CTX
if( !(p_smb = smbc_new_context()) )
{
- msg_Err( p_access, "out of memory" );
free( psz_uri );
return VLC_ENOMEM;
}
p_sys = (bonjour_t *)malloc( sizeof(*p_sys) );
if( p_sys == NULL )
- {
- msg_Err( p_log, "out of memory" );
return NULL;
- }
memset( p_sys, 0, sizeof(*p_sys) );
p_sys->psz_name = avahi_strdup( psz_name );
p_sys->psz_stype = avahi_strdup( psz_stype );
if( p_sys->psz_name == NULL || p_sys->psz_stype == NULL )
- {
- msg_Err( p_sys->p_log, "out of memory" );
goto error;
- }
if( psz_txt != NULL )
{
p_sys->psz_txt = avahi_strdup( psz_txt );
if( p_sys->psz_txt == NULL )
- {
- msg_Err( p_sys->p_log, "out of memory" );
goto error;
- }
}
p_sys->simple_poll = avahi_simple_poll_new();
p_sys->poll_thread = vlc_object_create( p_sys->p_log,
sizeof(poll_thread_t) );
if( p_sys->poll_thread == NULL )
- {
- msg_Err( p_sys->p_log, "out of memory" );
goto error;
- }
p_sys->poll_thread->simple_poll = p_sys->simple_poll;
if( vlc_thread_create( p_sys->poll_thread, "Avahi Poll Iterate Thread",
if( !( p_sys = p_access->p_sys =
malloc( sizeof( sout_access_out_sys_t ) ) ) )
- {
- msg_Err( p_access, "Not enough memory" );
return VLC_ENOMEM ;
- }
config_ChainParse( p_access, SOUT_CFG_PREFIX, ppsz_sout_options, p_access->p_cfg );
config_ChainParse( p_access, SOUT_CFG_PREFIX, ppsz_sout_options, p_access->p_cfg );
psz_accessname = psz_parser = strdup( p_access->psz_path );
+ if( !psz_parser )
+ return VLC_ENOMEM;
if( !p_access->psz_path )
{
p_sys = p_access->p_sys = malloc( sizeof( sout_access_out_sys_t ) );
if( !p_sys )
{
- msg_Err( p_access, "out of memory" );
free( psz_accessname );
return VLC_ENOMEM;
}
buf16_size = length;
buf16 = malloc( buf16_size );
if( buf16 == NULL )
- {
- msg_Err( p_demux, "out of memory" );
return NULL;
- }
for( i = 0; i < length; i++ )
{
buf8 = malloc( buf8_size + 1 );
if( buf8 == NULL )
{
- msg_Err( p_demux, "out of memory" );
free( buf16 );
return NULL;
}
prg = malloc( sizeof( ts_prg_psi_t ) );
if( !prg )
{
- msg_Err( p_demux, "out of memory" );
Close( VLC_OBJECT(p_demux) );
return VLC_ENOMEM;
}
/* Allocate structure */
p_sys = malloc( sizeof( filter_sys_t ) );
if( !p_sys )
- {
- msg_Err( p_filter, "out of memory" );
return VLC_ENOMEM;
- }
/* Initialize psz_template */
p_sys->psz_template = svg_GetTemplate( p_this );
if( !p_sys->psz_template )
{
- msg_Err( p_filter, "out of memory" );
free( p_sys );
return VLC_ENOMEM;
}
psz_template = malloc( ( s.st_size + 42 ) * sizeof( char ) );
if( !psz_template )
- {
- msg_Err( p_filter, "out of memory" );
return NULL;
- }
memset( psz_template, 0, s.st_size + 1 );
fread( psz_template, s.st_size, 1, file );
fclose( file );
p_svg = ( svg_rendition_t * )malloc( sizeof( svg_rendition_t ) );
if( !p_svg )
- {
- msg_Err( p_filter, "out of memory" );
return VLC_ENOMEM;
- }
p_region_out->i_x = p_region_in->i_x;
p_region_out->i_y = p_region_in->i_y;
p_svg->psz_text = strdup( psz_string );
if( !p_svg->psz_text )
{
- msg_Err( p_filter, "out of memory" );
free( p_svg );
return VLC_ENOMEM;
}
p_svg->psz_text = malloc( ( length + 1 ) * sizeof( char ) );
if( !p_svg->psz_text )
{
- msg_Err( p_filter, "out of memory" );
free( p_svg );
return VLC_ENOMEM;
}
/* Allocate structure */
p_filter->p_sys = p_sys = malloc( sizeof( filter_sys_t ) );
if( !p_sys )
- {
- msg_Err( p_filter, "out of memory" );
return VLC_ENOMEM;
- }
p_sys->i_font_size = 0;
p_sys->i_display_height = 0;
/* Allocate the memory needed to store the decoder's structure */
if( ( p_dec->p_sys = p_sys =
(decoder_sys_t *)malloc(sizeof(decoder_sys_t)) ) == NULL )
- {
- msg_Err( p_dec, "out of memory" );
- return VLC_EGENERIC;
- }
+ return VLC_ENOMEM;
/* Misc init */
p_sys->i_state = STATE_NOSYNC;
/* Allocate the memory needed to store the decoder's structure */
if( ( p_dec->p_sys = p_sys = malloc( sizeof(decoder_sys_t) ) ) == NULL )
- {
- msg_Err( p_dec, "out of memory" );
- return VLC_EGENERIC;
- }
+ return VLC_ENOMEM;
memset( p_sys, 0, sizeof(decoder_sys_t) );
/* Misc init */
/* Creating a window under Windows also initializes the thread's event
* message queue */
if( DirectXCreateWindow( p_event->p_vout ) )
- {
- msg_Err( p_event, "out of memory" );
p_event->b_dead = true;
- }
/* Signal the creation of the window */
vlc_thread_ready( p_event );