Commit 9c24e193 authored by Rémi Duraffort's avatar Rémi Duraffort

variables: fix a potential crash/double free.

Indeed, giving a NULL to var_Change(VLC_VAR_SETSTRING) will lead to a crash the
next time this variable is used.
parent cd824026
...@@ -623,6 +623,8 @@ int __var_Change( vlc_object_t *p_this, const char *psz_name, ...@@ -623,6 +623,8 @@ int __var_Change( vlc_object_t *p_this, const char *psz_name,
free( p_var->psz_text ); free( p_var->psz_text );
if( p_val && p_val->psz_string ) if( p_val && p_val->psz_string )
p_var->psz_text = strdup( p_val->psz_string ); p_var->psz_text = strdup( p_val->psz_string );
else
p_val->psz_text = NULL;
break; break;
case VLC_VAR_GETTEXT: case VLC_VAR_GETTEXT:
p_val->psz_string = NULL; p_val->psz_string = NULL;
......
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