On 08 Aug 2014, at 15:54, Martin Brejcha via RT <[email protected]> wrote:
> Hello,
>
> When I run our application in valgrind it shows memory leak in
> dgram_sctp_write:1262.
> Our application using openssl-1.0.1 for DTLS over sctp.
> The issue seems to be in sending of shutdown alarm. When shutdown alert
> is not sent because the socket is not dry, it is stored in bio object,
> but when the bio object is freed before this stored alarm can be sent,
> the shutdown alarm is not freed.
>
> Possible patch is attached.
The patch looks good to me.
Best regards
Michael
>
> Best regards,
> Martin Brejcha
>
> ________________________________
> This e-mail and any attachment is for authorised use by the intended
> recipient(s) only. It may contain proprietary material, confidential
> information and/or be subject to legal privilege. It should not be copied,
> disclosed to, retained or used by, any other party. If you are not an
> intended recipient then please promptly delete this e-mail and any attachment
> and all copies and inform the sender. Thank you for understanding.
>
> diff -u -u -r openssl-1.0.1i_old/crypto/bio/bss_dgram.c
> openssl-1.0.1i_new/crypto/bio/bss_dgram.c
> --- openssl-1.0.1i_old/crypto/bio/bss_dgram.c 2014-08-06 23:10:56.000000000
> +0200
> +++ openssl-1.0.1i_new/crypto/bio/bss_dgram.c 2014-08-08 13:26:00.307001406
> +0200
> @@ -982,7 +982,13 @@
> 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);
> }
______________________________________________________________________
OpenSSL Project http://www.openssl.org
Development Mailing List [email protected]
Automated List Manager [email protected]