]> git.sesse.net Git - vlc/commitdiff
Memory error handling
authorRémi Denis-Courmont <rem@videolan.org>
Sun, 16 Sep 2007 08:52:38 +0000 (08:52 +0000)
committerRémi Denis-Courmont <rem@videolan.org>
Sun, 16 Sep 2007 08:52:38 +0000 (08:52 +0000)
src/input/input.c

index b3e7317e5ee4508614ae29c5217f3b7d4c4b32ad..4d66ea63ccf99ce4266a0c89bb30a8a83f7ba326 100644 (file)
@@ -2120,9 +2120,9 @@ static int InputSourceInit( input_thread_t *p_input,
         {
             /* special hack for forcing a demuxer with --demux=module
              * (and do nothing with a list) */
-            char *psz_var_demux = var_GetString( p_input, "demux" );
+            char *psz_var_demux = var_GetNonEmptyString( p_input, "demux" );
 
-            if( *psz_var_demux != '\0' &&
+            if( psz_var_demux != NULL' &&
                 !strchr(psz_var_demux, ',' ) &&
                 !strchr(psz_var_demux, ':' ) )
             {
@@ -2130,10 +2130,7 @@ static int InputSourceInit( input_thread_t *p_input,
 
                 msg_Dbg( p_input, "enforced demux ` %s'", psz_demux );
             }
-            else if( psz_var_demux )
-            {
-                free( psz_var_demux );
-            }
+            free( psz_var_demux );
         }
 
         /* Try access_demux if no demux given */