Submitted by: Adam Langley <agl@chromium.org>
authorDr. Stephen Henson <steve@openssl.org>
Wed, 4 Jan 2012 14:25:10 +0000 (14:25 +0000)
committerDr. Stephen Henson <steve@openssl.org>
Wed, 4 Jan 2012 14:25:10 +0000 (14:25 +0000)
Reviewed by: steve

Fix memory leaks.

ssl/s3_srvr.c
ssl/t1_lib.c

index 89822de8f04cfe094e3c28daaf0d33a47d32da2d..4850a9a9570c20234e7e07484b2d26246d89f245 100644 (file)
@@ -1952,6 +1952,7 @@ int ssl3_get_client_key_exchange(SSL *s)
                if (i <= 0)
                        {
                        SSLerr(SSL_F_SSL3_GET_CLIENT_KEY_EXCHANGE,ERR_R_DH_LIB);
+                       BN_clear_free(pub);
                        goto err;
                        }
 
index 92cac130024af263f65cf049e2de87d6d086671d..cc97258ae5368780e74785454b799e3a73d2dc55 100644 (file)
@@ -575,6 +575,12 @@ int ssl_parse_clienthello_tlsext(SSL *s, unsigned char **p, unsigned char *d, in
                                sdata = data;
                                if (dsize > 0)
                                        {
+                                       if (s->tlsext_ocsp_exts)
+                                               {
+                                               sk_X509_EXTENSION_pop_free(s->tlsext_ocsp_exts,
+                                                                          X509_EXTENSION_free);
+                                               }
+
                                        s->tlsext_ocsp_exts =
                                                d2i_X509_EXTENSIONS(NULL,
                                                        &sdata, dsize);