Commit 3f27d44e authored by Rémi Duraffort's avatar Rémi Duraffort

vout_caca: fix potential memleak.

parent 2c48c5b1
/***************************************************************************** /*****************************************************************************
* caca.c: Color ASCII Art video output plugin using libcaca * caca.c: Color ASCII Art video output plugin using libcaca
***************************************************************************** *****************************************************************************
* Copyright (C) 2003, 2004 the VideoLAN team * Copyright (C) 2003-2009 the VideoLAN team
* $Id$ * $Id$
* *
* Authors: Sam Hocevar <sam@zoy.org> * Authors: Sam Hocevar <sam@zoy.org>
...@@ -163,12 +163,16 @@ static int Create( vlc_object_t *p_this ) ...@@ -163,12 +163,16 @@ static int Create( vlc_object_t *p_this )
/* Allocate structure */ /* Allocate structure */
p_vout->p_sys = malloc( sizeof( vout_sys_t ) ); p_vout->p_sys = malloc( sizeof( vout_sys_t ) );
if( p_vout->p_sys == NULL ) if( p_vout->p_sys == NULL )
{
FreeConsole();
return VLC_ENOMEM; return VLC_ENOMEM;
}
p_vout->p_sys->p_cv = cucul_create_canvas(0, 0); p_vout->p_sys->p_cv = cucul_create_canvas(0, 0);
if( !p_vout->p_sys->p_cv ) if( !p_vout->p_sys->p_cv )
{ {
msg_Err( p_vout, "cannot initialize libcucul" ); msg_Err( p_vout, "cannot initialize libcucul" );
FreeConsole();
free( p_vout->p_sys ); free( p_vout->p_sys );
return VLC_EGENERIC; return VLC_EGENERIC;
} }
...@@ -362,8 +366,7 @@ static int Manage( vout_thread_t *p_vout ) ...@@ -362,8 +366,7 @@ static int Manage( vout_thread_t *p_vout )
* p_vout->render.i_height * p_vout->render.i_height
/ cucul_get_canvas_height( p_vout->p_sys->p_cv ); / cucul_get_canvas_height( p_vout->p_sys->p_cv );
var_Set( p_vout, "mouse-y", val ); var_Set( p_vout, "mouse-y", val );
val.b_bool = true; var_SetBool( p_vout, "mouse-moved", true );
var_Set( p_vout, "mouse-moved", val );
break; break;
case CACA_EVENT_MOUSE_RELEASE: case CACA_EVENT_MOUSE_RELEASE:
var_SetBool( p_vout, "mouse-clicked", true ); var_SetBool( p_vout, "mouse-clicked", true );
......
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