Free any existing SRTP connection profile
authorMatt Caswell <matt@openssl.org>
Thu, 5 May 2016 19:59:03 +0000 (20:59 +0100)
committerMatt Caswell <matt@openssl.org>
Mon, 9 May 2016 09:25:34 +0000 (10:25 +0100)
When setting a new SRTP connection profile using
SSL_CTX_set_tlsext_use_srtp() or SSL_set_tlsext_use_srtp() we should
free any existing profile first to avoid a memory leak.

Reviewed-by: Kurt Roeckx <kurt@openssl.org>
ssl/d1_srtp.c

index f969fb1..e49aea9 100644 (file)
@@ -197,6 +197,8 @@ static int ssl_ctx_make_profiles(const char *profiles_string,
             ptr = col + 1;
     } while (col);
 
+    sk_SRTP_PROTECTION_PROFILE_free(*out);
+
     *out = profiles;
 
     return 0;