Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ConditionalAccessClose do not freeing memory ... #18

Closed
ghost opened this issue May 24, 2018 · 0 comments
Closed

ConditionalAccessClose do not freeing memory ... #18

ghost opened this issue May 24, 2018 · 0 comments

Comments

@ghost
Copy link

ghost commented May 24, 2018

I have found a possible missing of "freeing memory" on "ConditionalAccessClose".

During call of "ConditionalAccessHandle" the function allocate memory for "system_ids" :

        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".

    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 ?

@gfto gfto closed this as completed Oct 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant