]> git.sesse.net Git - vlc/blobdiff - modules/access_output/http.c
Don't leak every https parameters.
[vlc] / modules / access_output / http.c
index 0ab10976254dbbf1d68349b6acef7777eb1f5fab..fff220d4a19b88b343063083dcf9bf48fc4cd0a9 100644 (file)
@@ -30,7 +30,8 @@
 # include "config.h"
 #endif
 
-#include <vlc/vlc.h>
+#include <vlc_common.h>
+#include <vlc_plugin.h>
 #include <vlc_sout.h>
 #include <vlc_block.h>
 
@@ -91,7 +92,7 @@ static void Close( vlc_object_t * );
 
 
 vlc_module_begin();
-    set_description( _("HTTP stream output") );
+    set_description( N_("HTTP stream output") );
     set_capability( "sout access", 0 );
     set_shortname( "HTTP" );
     add_shortcut( "http" );
@@ -122,7 +123,7 @@ vlc_module_end();
 /*****************************************************************************
  * Exported prototypes
  *****************************************************************************/
-static const char *ppsz_sout_options[] = {
+static const char *const ppsz_sout_options[] = {
     "user", "pwd", "mime", "cert", "key", "ca", "crl", NULL
 };
 
@@ -164,16 +165,13 @@ static int Open( vlc_object_t *p_this )
     char                *psz_user = NULL;
     char                *psz_pwd = NULL;
     char                *psz_mime = NULL;
-    const char          *psz_cert = NULL, *psz_key = NULL, *psz_ca = NULL,
+    char                *psz_cert = NULL, *psz_key = NULL, *psz_ca = NULL,
                         *psz_crl = NULL;
     vlc_value_t         val;
 
     if( !( p_sys = p_access->p_sys =
                 malloc( sizeof( sout_access_out_sys_t ) ) ) )
-    {
-        msg_Err( p_access, "Not enough memory" );
         return VLC_ENOMEM ;
-    }
 
     config_ChainParse( p_access, SOUT_CFG_PREFIX, ppsz_sout_options, p_access->p_cfg );
 
@@ -243,6 +241,11 @@ static int Open( vlc_object_t *p_this )
                                             psz_bind_addr, i_bind_port,
                                             psz_cert, psz_key, psz_ca,
                                             psz_crl );
+    free( psz_cert );
+    free( psz_key );
+    free( psz_ca );
+    free( psz_crl );
+
     if( p_sys->p_httpd_host == NULL )
     {
         msg_Err( p_access, "cannot listen on %s:%d",
@@ -311,7 +314,7 @@ static int Open( vlc_object_t *p_this )
         if( psz_file_name &&
             asprintf( &psz_txt, "path=%s", psz_file_name ) == -1 )
             {
-                pl_Release( p_playlist );
+                pl_Release( p_access );
                 free( psz_uri );
                 return VLC_ENOMEM;
             }
@@ -325,7 +328,7 @@ static int Open( vlc_object_t *p_this )
 
         if( p_sys->p_bonjour == NULL )
             msg_Err( p_access, "unable to start requested Bonjour announce" );
-        pl_Release( p_playlist );
+        pl_Release( p_access );
     }
     else
         p_sys->p_bonjour = NULL;