Fixed memory leak in the event of a failure of BUF_MEM_grow
authorMatt Caswell <matt@openssl.org>
Thu, 4 Dec 2014 09:56:16 +0000 (09:56 +0000)
committerMatt Caswell <matt@openssl.org>
Mon, 8 Dec 2014 16:51:01 +0000 (16:51 +0000)
Reviewed-by: Richard Levitte <levitte@openssl.org>
(cherry picked from commit 41bf25013032da0eeb111ce3c8fc0946c0e61c41)

ssl/s3_srvr.c

index 2a56f2beca0df4c339963f6a0f7085f9e544e05c..546d633e344d61e529d9ee99e906e039209a1612 100644 (file)
@@ -246,6 +246,7 @@ int ssl3_accept(SSL *s)
                                        }
                                if (!BUF_MEM_grow(buf,SSL3_RT_MAX_PLAIN_LENGTH))
                                        {
+                                       BUF_MEM_free(buf);
                                        ret= -1;
                                        goto end;
                                        }