[vlc-commits] gnutls: fix memory leak in error case
Rémi Denis-Courmont
git at videolan.org
Sat Sep 29 18:10:57 CEST 2012
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sat Sep 29 15:16:20 2012 +0300| [38150d6e9de4d8d382149aa2e174b565958ceef7] | committer: Rémi Denis-Courmont
gnutls: fix memory leak in error case
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=38150d6e9de4d8d382149aa2e174b565958ceef7
---
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..1f3d7b0 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 (obj);
return VLC_EGENERIC;
}
More information about the vlc-commits
mailing list