[vlc-devel] commit: Avoid potential segfault and fix potential memleak. ( Rémi Duraffort )

git version control git at videolan.org
Mon Jul 14 16:08:57 CEST 2008


vlc | branch: master | Rémi Duraffort <ivoire at videolan.org> | Sat Jul 12 13:20:23 2008 +0200| [9d65e77152039fcb91ff55e8a590bafc17f642c0]

Avoid potential segfault and fix potential memleak.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=9d65e77152039fcb91ff55e8a590bafc17f642c0
---

 src/input/demux.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/src/input/demux.c b/src/input/demux.c
index be8f48e..9aa2105 100644
--- a/src/input/demux.c
+++ b/src/input/demux.c
@@ -54,7 +54,7 @@ demux_t *__demux_New( vlc_object_t *p_obj,
     p_demux->psz_path   = strdup( psz_path );
 
     /* Take into account "demux" to be able to do :demux=dump */
-    if( *p_demux->psz_demux == '\0' )
+    if( p_demux->psz_demux && *p_demux->psz_demux == '\0' )
     {
         free( p_demux->psz_demux );
         p_demux->psz_demux = var_GetNonEmptyString( p_obj, "demux" );
@@ -358,6 +358,7 @@ stream_t *__stream_DemuxNew( vlc_object_t *p_obj, const char *psz_demux,
                            VLC_THREAD_PRIORITY_INPUT, false ) )
     {
         vlc_object_release( s );
+        free( p_sys->psz_name );
         free( p_sys );
         return NULL;
     }




More information about the vlc-devel mailing list