Commit 0f14935d authored by Rémi Duraffort's avatar Rémi Duraffort

Fix potential memleak (cid #1049846)

parent 7301a709
...@@ -1234,11 +1234,10 @@ static int UserPmt( demux_t *p_demux, const char *psz_fmt ) ...@@ -1234,11 +1234,10 @@ static int UserPmt( demux_t *p_demux, const char *psz_fmt )
PIDInit( pmt, true, NULL ); PIDInit( pmt, true, NULL );
/* Dummy PMT */ /* Dummy PMT */
prg = malloc( sizeof( ts_prg_psi_t ) ); prg = calloc( 1, sizeof( ts_prg_psi_t ) );
if( !prg ) if( !prg )
goto error; goto error;
memset( prg, 0, sizeof( ts_prg_psi_t ) );
prg->i_pid_pcr = -1; prg->i_pid_pcr = -1;
prg->i_pid_pmt = -1; prg->i_pid_pmt = -1;
prg->i_version = -1; prg->i_version = -1;
...@@ -1341,6 +1340,7 @@ static int UserPmt( demux_t *p_demux, const char *psz_fmt ) ...@@ -1341,6 +1340,7 @@ static int UserPmt( demux_t *p_demux, const char *psz_fmt )
return VLC_SUCCESS; return VLC_SUCCESS;
error: error:
free( prg );
free( psz_dup ); free( psz_dup );
return VLC_EGENERIC; return VLC_EGENERIC;
} }
......
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