]> git.sesse.net Git - vlc/commitdiff
vlm: reduce deletion complexity and help analyzers
authorRémi Duraffort <ivoire@videolan.org>
Tue, 31 Dec 2013 15:02:27 +0000 (16:02 +0100)
committerRémi Duraffort <ivoire@videolan.org>
Thu, 2 Jan 2014 08:15:37 +0000 (09:15 +0100)
src/input/vlmshell.c

index 2573f81d2b9046a5473326cc3fb777a0f6bff8c2..33287ac214794cad6677bc9aa173e2b5e9077ca8 100644 (file)
@@ -990,18 +990,17 @@ static vlm_schedule_sys_t *vlm_ScheduleNew( vlm_t *vlm, const char *psz_name )
 /* for now, simple delete. After, del with options (last arg) */
 void vlm_ScheduleDelete( vlm_t *vlm, vlm_schedule_sys_t *sched )
 {
+    int i;
     if( sched == NULL ) return;
 
     TAB_REMOVE( vlm->i_schedule, vlm->schedule, sched );
 
     if( vlm->i_schedule == 0 ) free( vlm->schedule );
     free( sched->psz_name );
-    while( sched->i_command )
-    {
-        char *psz_cmd = sched->command[0];
-        TAB_REMOVE( sched->i_command, sched->command, psz_cmd );
-        free( psz_cmd );
-    }
+
+    for ( i = 0; i < sched->i_command; i++ )
+        free( sched->command[i] );
+    free( sched->command );
     free( sched );
 }