src/control/mediacontrol_core.c:349: Memory leak: retval
In file src/control/mediacontrol_core.c:349: Variable retval leaks memory in macro call if NULL is returned there.
retval = ( mediacontrol_StreamInformation* )
malloc( sizeof( mediacontrol_StreamInformation ) );
if( ! retval )
{
RAISE( mediacontrol_InternalException, "Out of memory" );
return NULL;
}
p_media = libvlc_media_player_get_media( self->p_media_player, &ex );
HANDLE_LIBVLC_EXCEPTION_NULL( &ex );
#define HANDLE_LIBVLC_EXCEPTION_NULL( e ) if( libvlc_exception_raised( e ) ) { \
RAISE( mediacontrol_InternalException, libvlc_exception_get_message( e )); \
libvlc_exception_clear( e ); \
return NULL; }
This bug was found using cppcheck: http://cppcheck.wiki.sourceforge.net/