Commit 91af1609 authored by Derk-Jan Hartman's avatar Derk-Jan Hartman

potential NULL deref (CID 150)

(cherry picked from commit 8a9bd2d8)
Signed-off-by: default avatarDerk-Jan Hartman <hartman@videolan.org>
parent 3302b09b
......@@ -286,7 +286,15 @@ stream_t *stream_AccessNew( access_t *p_access, bool b_quick )
stream_sys_t *p_sys;
char *psz_list = NULL;
if( !s ) return NULL;
if( !s )
return NULL;
s->p_sys = p_sys = malloc( sizeof( stream_sys_t ) );
if( !p_sys )
{
vlc_object_release( s );
return NULL;
}
/* Attach it now, needed for b_die */
vlc_object_attach( s, p_access );
......@@ -296,10 +304,6 @@ stream_t *stream_AccessNew( access_t *p_access, bool b_quick )
s->pf_control = AStreamControl;
s->pf_destroy = AStreamDestroy;
s->p_sys = p_sys = malloc( sizeof( stream_sys_t ) );
if( p_sys == NULL )
goto error;
/* UTF16 and UTF32 text file conversion */
s->i_char_width = 1;
s->b_little_endian = false;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment