[vlc-devel] win32_specific.c memory leak

Brian Robb vascy at hotmail.com
Sun Sep 4 20:33:59 CEST 2005


There's a memory leak in win32_specific.c...

You have:

void system_End( vlc_t *p_this )
{
    WSACleanup();
}

But it should be:

void system_End( vlc_t *p_this )
{
    if ( p_this && p_this->p_libvlc && p_this->p_libvlc->psz_vlcpath) {
	free( p_this->p_libvlc->psz_vlcpath );
        p_this->p_libvlc->psz_vlcpath = NULL;
    }

    WSACleanup();
}

Without this, the strdup that is stored in p_this->p_libvlc->psz_vlcpath is 
leaked.

(The void system_End( vlc_t *p_this ) in beos_specific.c has
a free( p_this->p_libvlc->psz_vlcpath ); here too,
so it should be in the right place.)

:)


-- 
This is the vlc-devel mailing-list, see http://www.videolan.org/vlc/
To unsubscribe, please read http://developers.videolan.org/lists.html



More information about the vlc-devel mailing list