diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2014-07-14 08:21:48 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2014-07-14 08:21:48 +0000 |
commit | b761030976b594e8ae4af67b6b9ce8502a998d6a (patch) | |
tree | 9f1bf62b34760a896513a0f2bce6600d3a885a63 /lib | |
parent | c358aed75025293040cdae8403e706edc2c74238 (diff) |
Fix memory leak upon error in ssl_parse_clienthello_use_srtp_ext().
From BoringSSL.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libssl/src/ssl/d1_srtp.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/libssl/src/ssl/d1_srtp.c b/lib/libssl/src/ssl/d1_srtp.c index c39cb95f19e..3492b7d1d02 100644 --- a/lib/libssl/src/ssl/d1_srtp.c +++ b/lib/libssl/src/ssl/d1_srtp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: d1_srtp.c,v 1.7 2014/06/29 12:25:47 jsing Exp $ */ +/* $OpenBSD: d1_srtp.c,v 1.8 2014/07/14 08:21:47 miod Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -299,14 +299,14 @@ ssl_parse_clienthello_use_srtp_ext(SSL *s, unsigned char *d, int len, int *al) int mki_len; int i, j; int id; - int ret; + int ret = 1; /* Length value + the MKI length */ if (len < 3) { SSLerr(SSL_F_SSL_PARSE_CLIENTHELLO_USE_SRTP_EXT, SSL_R_BAD_SRTP_PROTECTION_PROFILE_LIST); *al = SSL_AD_DECODE_ERROR; - return 1; + goto done; } /* Pull off the length of the cipher suite list */ @@ -318,7 +318,7 @@ ssl_parse_clienthello_use_srtp_ext(SSL *s, unsigned char *d, int len, int *al) SSLerr(SSL_F_SSL_PARSE_CLIENTHELLO_USE_SRTP_EXT, SSL_R_BAD_SRTP_PROTECTION_PROFILE_LIST); *al = SSL_AD_DECODE_ERROR; - return 1; + goto done; } /* Check that lengths are consistent */ @@ -326,7 +326,7 @@ ssl_parse_clienthello_use_srtp_ext(SSL *s, unsigned char *d, int len, int *al) SSLerr(SSL_F_SSL_PARSE_CLIENTHELLO_USE_SRTP_EXT, SSL_R_BAD_SRTP_PROTECTION_PROFILE_LIST); *al = SSL_AD_DECODE_ERROR; - return 1; + goto done; } @@ -354,7 +354,7 @@ ssl_parse_clienthello_use_srtp_ext(SSL *s, unsigned char *d, int len, int *al) SSL_R_BAD_SRTP_MKI_VALUE); *al = SSL_AD_DECODE_ERROR; sk_SRTP_PROTECTION_PROFILE_free(clnt); - return 1; + goto done; } srvr = SSL_get_srtp_profiles(s); |