[openssl-commits] [openssl] OpenSSL source code branch OpenSSL_1_0_1-stable updated. OpenSSL_1_0_1j-102-g61052e8

Dr. Stephen Henson steve at openssl.org
Tue Jan 6 16:50:01 UTC 2015


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "OpenSSL source code".

The branch, OpenSSL_1_0_1-stable has been updated
       via  61052e891e0686ac3b08dd3b0e0b20fd4c786cc4 (commit)
      from  cb951e336bafb0f98896e12fda41af6b6eef5fb2 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 61052e891e0686ac3b08dd3b0e0b20fd4c786cc4
Author: Martin Brejcha <martin.brejcha at acision.com>
Date:   Sun Nov 16 17:04:40 2014 +0000

    Fix memory leak.
    
    Fix memory leak by freeing up saved_message.data if it is not NULL.
    
    PR#3489
    Reviewed-by: Stephen Henson <steve at openssl.org>
    Reviewed-by: Tim Hudson <tjh at openssl.org>
    
    (cherry picked from commit 41cd41c4416f545a18ead37e09e437c75fa07c95)

-----------------------------------------------------------------------

Summary of changes:
 crypto/bio/bss_dgram.c |   12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/crypto/bio/bss_dgram.c b/crypto/bio/bss_dgram.c
index 53588e1..0decf94 100644
--- a/crypto/bio/bss_dgram.c
+++ b/crypto/bio/bss_dgram.c
@@ -1046,7 +1046,12 @@ static int dgram_sctp_free(BIO *a)
 		return 0;
 
 	data = (bio_dgram_sctp_data *)a->ptr;
-	if(data != NULL) OPENSSL_free(data);
+	if(data != NULL)
+		{
+		if(data->saved_message.data != NULL)
+			OPENSSL_free(data->saved_message.data);
+		OPENSSL_free(data);
+		}
 
 	return(1);
 	}
@@ -1163,6 +1168,7 @@ static int dgram_sctp_read(BIO *b, char *out, int outl)
 						dgram_sctp_write(data->saved_message.bio, data->saved_message.data,
 						                 data->saved_message.length);
 						OPENSSL_free(data->saved_message.data);
+						data->saved_message.data = NULL;
 						data->saved_message.length = 0;
 						}
 
@@ -1334,9 +1340,11 @@ static int dgram_sctp_write(BIO *b, const char *in, int inl)
 	if (data->save_shutdown && !BIO_dgram_sctp_wait_for_dry(b))
 	{
 		data->saved_message.bio = b;
-		data->saved_message.length = inl;
+		if (data->saved_message.data)
+			OPENSSL_free(data->saved_message.data);
 		data->saved_message.data = OPENSSL_malloc(inl);
 		memcpy(data->saved_message.data, in, inl);
+		data->saved_message.length = inl;
 		return inl;
 	}
 


hooks/post-receive
-- 
OpenSSL source code


More information about the openssl-commits mailing list