Fixed memory leak if BUF_MEM_grow fails
authorMatt Caswell <matt@openssl.org>
Fri, 12 Dec 2014 11:03:00 +0000 (11:03 +0000)
committerMatt Caswell <matt@openssl.org>
Sat, 13 Dec 2014 00:03:58 +0000 (00:03 +0000)
Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Kurt Roeckx <kurt@openssl.org>
ssl/d1_srvr.c
ssl/s23_srvr.c

index 0841183..5f15467 100644 (file)
@@ -251,6 +251,7 @@ int dtls1_accept(SSL *s)
                                        }
                                if (!BUF_MEM_grow(buf,SSL3_RT_MAX_PLAIN_LENGTH))
                                        {
+                                       BUF_MEM_free(buf);
                                        ret= -1;
                                        goto end;
                                        }
index e656ac2..9840d47 100644 (file)
@@ -192,6 +192,7 @@ int ssl23_accept(SSL *s)
                                        }
                                if (!BUF_MEM_grow(buf,SSL3_RT_MAX_PLAIN_LENGTH))
                                        {
+                                       BUF_MEM_free(buf);
                                        ret= -1;
                                        goto end;
                                        }