From: Laurent Aimar Date: Mon, 16 Mar 2009 20:09:44 +0000 (+0100) Subject: Make sure that var_Get on a string will return a non NULL value. X-Git-Tag: 1.0.0-pre1~17 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=d463e6950ca53a32aa6ff5b2ed79ca2d976cf6c4;p=vlc Make sure that var_Get on a string will return a non NULL value. The current code assume it everywhere. --- diff --git a/src/misc/variables.c b/src/misc/variables.c index be8185690d..80caffffe7 100644 --- a/src/misc/variables.c +++ b/src/misc/variables.c @@ -68,7 +68,7 @@ static int CmpAddress( vlc_value_t v, vlc_value_t w ) { return v.p_address == w. * Local duplication functions, and local deallocation functions *****************************************************************************/ static void DupDummy( vlc_value_t *p_val ) { (void)p_val; /* unused */ } -static void DupString( vlc_value_t *p_val ) { if( p_val->psz_string ) p_val->psz_string = strdup( p_val->psz_string ); } +static void DupString( vlc_value_t *p_val ) { p_val->psz_string = strdup( p_val->psz_string ?: ""); } static void DupList( vlc_value_t *p_val ) {