Commit a6fd99e4 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

lua: fix memory leak when getting/inherting string variable

parent b8ab8070
......@@ -128,7 +128,10 @@ static int vlclua_var_inherit( lua_State *L )
return 0;
lua_pop( L, 2 );
return vlclua_pushvalue( L, i_type, val );
vlclua_pushvalue( L, i_type, val );
if( i_type == VLC_VAR_STRING )
free( val.psz_string );
return 1;
}
static int vlclua_var_get( lua_State *L )
......@@ -142,7 +145,10 @@ static int vlclua_var_get( lua_State *L )
return 0;
lua_pop( L, 2 );
return vlclua_pushvalue( L, i_type, val );
vlclua_pushvalue( L, i_type, val );
if( i_type == VLC_VAR_STRING )
free( val.psz_string );
return 1;
}
static int vlclua_var_set( lua_State *L )
......
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