[dvblast-devel] Possibile missing of "freeing memory" on "ConditionalAccessClose" ...

debugasm debugasm at gmail.com
Sat Oct 20 19:02:40 CEST 2018


During call of "ConditionalAccessHandle" the function allocate memory 
for "system_ids" (line 1361) :

     p_ids->i_nb_system_ids = l / 2;
     p_ids->pi_system_ids = malloc( p_ids->i_nb_system_ids
                                     * sizeof(uint16_t) );

After removing the DVB-CI slot cam the prevoius allocate memory is not 
"freed" (line 1395).

     msg_Dbg( p_access, "closing ConditionalAccess session (%d)", 
i_session_id );
     free( p_sessions[i_session_id - 1].p_sys );

the memory allocated for system id is not released.

I guess the right code should be:

     system_ids_t *p_ids =
         (system_ids_t *)p_sessions[i_session_id - 1].p_sys;

     if ( p_ids->i_nb_system_ids )
         free( p_ids->pi_system_ids );

     msg_Dbg( p_access, "closing ConditionalAccess session (%d)", 
i_session_id );
     free( p_sessions[i_session_id - 1].p_sys );

Am I right ?

debugasm

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/dvblast-devel/attachments/20181020/c8646cf5/attachment.html>


More information about the dvblast-devel mailing list