]> git.sesse.net Git - vlc/commitdiff
vlm: memory leak
authorRémi Denis-Courmont <remi@remlab.net>
Mon, 17 Nov 2014 17:03:20 +0000 (19:03 +0200)
committerRémi Denis-Courmont <remi@remlab.net>
Mon, 17 Nov 2014 17:03:20 +0000 (19:03 +0200)
src/input/vlmshell.c

index 50a3859fe2f8ffbcb2119da83e3e02ce6cf14102..9c254347f3454c925a53e89c59a43f56d0a5ed94 100644 (file)
@@ -602,7 +602,7 @@ static int ExecuteScheduleProperty( vlm_t *p_vlm, vlm_schedule_sys_t *p_schedule
             if( ++i >= i_property )
                 break;
 
-            psz_line = strdup( ppsz_property[i] );
+            psz_line = xstrdup( ppsz_property[i] );
             for( j = i+1; j < i_property; j++ )
             {
                 psz_line = xrealloc( psz_line,
@@ -611,7 +611,9 @@ static int ExecuteScheduleProperty( vlm_t *p_vlm, vlm_schedule_sys_t *p_schedule
                 strcat( psz_line, ppsz_property[j] );
             }
 
-            if( vlm_ScheduleSetup( p_schedule, "append", psz_line ) )
+            int val = vlm_ScheduleSetup( p_schedule, "append", psz_line );
+            free( psz_line );
+            if( val )
                 goto error;
             break;
         }