[vlc-commits] gnutls: fix memory leak in error case

Rémi Denis-Courmont git at videolan.org
Sat Sep 29 17:36:45 CEST 2012


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sat Sep 29 15:16:20 2012 +0300| [ec3f3aeb44e1bd70be0eec39831463d6938ef850] | committer: Rémi Denis-Courmont

gnutls: fix memory leak in error case

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

 modules/misc/gnutls.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/modules/misc/gnutls.c b/modules/misc/gnutls.c
index 12d28b9..661a1cd 100644
--- a/modules/misc/gnutls.c
+++ b/modules/misc/gnutls.c
@@ -785,7 +785,7 @@ static int OpenServer (vlc_object_t *obj)
 
     vlc_tls_creds_sys_t *sys = malloc (sizeof (*sys));
     if (unlikely(sys == NULL))
-        return VLC_ENOMEM;
+        goto error;
 
     server->sys     = sys;
     server->add_CA  = gnutls_ServerAddCA;
@@ -849,6 +849,7 @@ static int OpenServer (vlc_object_t *obj)
 
 error:
     free (sys);
+    gnutls_Deinit (VLC_OBJECT(crd));
     return VLC_EGENERIC;
 }
 



More information about the vlc-commits mailing list