From 9e895a7e0d9c1352bc40533f201a49ae796260a1 Mon Sep 17 00:00:00 2001 From: logan <> Date: Sat, 28 Jun 2014 18:05:27 +0000 Subject: Fix 2 memory leaks. (Thanks to Brent Cook) OK from tedu@ --- src/lib/libssl/d1_srtp.c | 4 +++- src/lib/libssl/src/ssl/d1_srtp.c | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'src/lib') diff --git a/src/lib/libssl/d1_srtp.c b/src/lib/libssl/d1_srtp.c index 6962a4a1ce..4a9a6b2ea8 100644 --- a/src/lib/libssl/d1_srtp.c +++ b/src/lib/libssl/d1_srtp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: d1_srtp.c,v 1.5 2014/06/12 15:49:31 deraadt Exp $ */ +/* $OpenBSD: d1_srtp.c,v 1.6 2014/06/28 18:05:27 logan Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -197,6 +197,7 @@ ssl_ctx_make_profiles(const char *profiles_string, sk_SRTP_PROTECTION_PROFILE_push(profiles, p); } else { SSLerr(SSL_F_SSL_CTX_MAKE_PROFILES, SSL_R_SRTP_UNKNOWN_PROTECTION_PROFILE); + sk_SRTP_PROTECTION_PROFILE_free(profiles); return 1; } @@ -344,6 +345,7 @@ ssl_parse_clienthello_use_srtp_ext(SSL *s, unsigned char *d, int len, int *al) if (mki_len != len) { SSLerr(SSL_F_SSL_PARSE_CLIENTHELLO_USE_SRTP_EXT, SSL_R_BAD_SRTP_MKI_VALUE); *al = SSL_AD_DECODE_ERROR; + sk_SRTP_PROTECTION_PROFILE_free(clnt); return 1; } diff --git a/src/lib/libssl/src/ssl/d1_srtp.c b/src/lib/libssl/src/ssl/d1_srtp.c index 6962a4a1ce..4a9a6b2ea8 100644 --- a/src/lib/libssl/src/ssl/d1_srtp.c +++ b/src/lib/libssl/src/ssl/d1_srtp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: d1_srtp.c,v 1.5 2014/06/12 15:49:31 deraadt Exp $ */ +/* $OpenBSD: d1_srtp.c,v 1.6 2014/06/28 18:05:27 logan Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -197,6 +197,7 @@ ssl_ctx_make_profiles(const char *profiles_string, sk_SRTP_PROTECTION_PROFILE_push(profiles, p); } else { SSLerr(SSL_F_SSL_CTX_MAKE_PROFILES, SSL_R_SRTP_UNKNOWN_PROTECTION_PROFILE); + sk_SRTP_PROTECTION_PROFILE_free(profiles); return 1; } @@ -344,6 +345,7 @@ ssl_parse_clienthello_use_srtp_ext(SSL *s, unsigned char *d, int len, int *al) if (mki_len != len) { SSLerr(SSL_F_SSL_PARSE_CLIENTHELLO_USE_SRTP_EXT, SSL_R_BAD_SRTP_MKI_VALUE); *al = SSL_AD_DECODE_ERROR; + sk_SRTP_PROTECTION_PROFILE_free(clnt); return 1; } -- cgit v1.2.3-55-g6feb