]> git.sesse.net Git - vlc/commitdiff
* modules/access_output/http.c: fixed small mem leak and mem corruption.
authorGildas Bazin <gbazin@videolan.org>
Thu, 15 Jan 2004 22:58:12 +0000 (22:58 +0000)
committerGildas Bazin <gbazin@videolan.org>
Thu, 15 Jan 2004 22:58:12 +0000 (22:58 +0000)
modules/access_output/http.c

index d46ced6886f75b052a3c4fb7f50887a28d65a341..641c43970243ef90875e6a487b6f888a38842cb9 100644 (file)
@@ -2,7 +2,7 @@
  * http.c
  *****************************************************************************
  * Copyright (C) 2001-2003 VideoLAN
- * $Id: http.c,v 1.8 2003/12/06 22:50:08 jpsaman Exp $
+ * $Id: http.c,v 1.9 2004/01/15 22:58:12 gbazin Exp $
  *
  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
  *
@@ -191,6 +191,10 @@ static int Open( vlc_object_t *p_this )
         strcpy( psz_file_name, "/" );
         strcat( psz_file_name, p );
     }
+    else
+    {
+        psz_file_name = strdup( psz_file_name );
+    }
 
     p_sys->p_httpd = httpd_Find( VLC_OBJECT(p_access), VLC_TRUE );
     if( !p_sys->p_httpd )
@@ -246,6 +250,9 @@ static int Open( vlc_object_t *p_this )
         return( VLC_EGENERIC );
     }
 
+    free( psz_file_name );
+    free( psz_name );
+
     p_sys->i_header_allocated = 1024;
     p_sys->i_header_size      = 0;
     p_sys->p_header           = malloc( p_sys->i_header_allocated );