[vlc-commits] gnutls: move error label
Thomas Guillem
git at videolan.org
Wed Jul 13 15:43:43 CEST 2016
vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Tue Jul 12 17:14:08 2016 +0200| [545426f90b6b7afa07e72c816692b12aa156d4ee] | committer: Thomas Guillem
gnutls: move error label
Going up to an error label is disturbing.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=545426f90b6b7afa07e72c816692b12aa156d4ee
---
modules/misc/gnutls.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/modules/misc/gnutls.c b/modules/misc/gnutls.c
index 4a3d2d4..1b9c315 100644
--- a/modules/misc/gnutls.c
+++ b/modules/misc/gnutls.c
@@ -426,10 +426,7 @@ static int gnutls_ClientHandshake(vlc_tls_creds_t *creds, vlc_tls_t *tls,
{
msg_Err(creds, "Certificate verification error: %s",
gnutls_strerror(val));
-error:
- if (alp != NULL)
- free(*alp);
- return -1;
+ goto error;
}
if (status == 0) /* Good certificate */
@@ -535,6 +532,11 @@ error:
goto error;
}
return 0;
+
+error:
+ if (alp != NULL)
+ free(*alp);
+ return -1;
}
/**
More information about the vlc-commits
mailing list