[vlc-devel] commit: control http: fix memleak. ( Rémi Duraffort )

git version control git at videolan.org
Thu Jul 31 13:20:57 CEST 2008


vlc | branch: master | Rémi Duraffort <ivoire at videolan.org> | Thu Jul 31 13:23:58 2008 +0200| [696ef23c5d997c56e5fe0daaaf4b382832d35baf]

control http: fix memleak.

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

 modules/control/http/http.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/modules/control/http/http.c b/modules/control/http/http.c
index eed8cea..54cce0b 100644
--- a/modules/control/http/http.c
+++ b/modules/control/http/http.c
@@ -121,7 +121,7 @@ static int Open( vlc_object_t *p_this )
     intf_thread_t *p_intf = (intf_thread_t*)p_this;
     intf_sys_t    *p_sys;
     char          *psz_address;
-    const char    *psz_cert = NULL, *psz_key = NULL, *psz_ca = NULL,
+    char          *psz_cert = NULL, *psz_key = NULL, *psz_ca = NULL,
                   *psz_crl = NULL;
     int           i_port       = 0;
     char          *psz_src = NULL;
@@ -219,6 +219,11 @@ static int Open( vlc_object_t *p_this )
     p_sys->p_httpd_host = httpd_TLSHostNew( VLC_OBJECT(p_intf), psz_address,
                                             i_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_intf, "cannot listen on %s:%d", psz_address, i_port );




More information about the vlc-devel mailing list