]> git.sesse.net Git - vlc/commitdiff
Fix memleaks in stream output.
authorRémi Duraffort <ivoire@videolan.org>
Thu, 31 Jul 2008 13:50:47 +0000 (15:50 +0200)
committerRémi Duraffort <ivoire@videolan.org>
Thu, 31 Jul 2008 13:51:20 +0000 (15:51 +0200)
modules/stream_out/standard.c

index 72b97e73f11baefbef960555fc75031abeaa9820..a7c5d24904372fd5d21905f1c3e227ed80dc2712 100644 (file)
@@ -217,7 +217,11 @@ static int Open( vlc_object_t *p_this )
         free( val.psz_string );
 
     p_sys = p_stream->p_sys = malloc( sizeof( sout_stream_sys_t) );
-    if( !p_sys ) return VLC_ENOMEM;
+    if( !p_sys )
+    {
+        free( psz_url );
+        return VLC_ENOMEM;
+    }
     p_stream->p_sys->p_session = NULL;
 
     msg_Dbg( p_this, "creating `%s/%s://%s'", psz_access, psz_mux, psz_url );
@@ -278,6 +282,7 @@ static int Open( vlc_object_t *p_this )
         else
         {
             msg_Err( p_stream, "no access _and_ no muxer (fatal error)" );
+            free( psz_url );
             free( p_sys );
             return VLC_EGENERIC;
         }
@@ -370,6 +375,7 @@ static int Open( vlc_object_t *p_this )
                  psz_access, psz_mux, psz_url );
         free( psz_access );
         free( psz_mux );
+        free( psz_url );
         free( p_sys );
         return VLC_EGENERIC;
     }
@@ -385,6 +391,7 @@ static int Open( vlc_object_t *p_this )
         sout_AccessOutDelete( p_access );
         free( psz_access );
         free( psz_mux );
+        free( psz_url );
         free( p_sys );
         return VLC_EGENERIC;
     }