On 19/07/14 15:53, Iñaki Baz Castillo wrote:
> Hi,
> 
> The doc [*] says:
> 
> "If the BIO_CLOSE flag is set when a memory BIO is freed then the
> underlying BUF_MEM structure is also freed."
> 
> The only place to set such a BIO_CLOSE flag is in the c argument in function:
> 
> BIO_set_mem_buf(BIO *b,BUF_MEM *bm,int c)

You can also call BIO_set_close.

> 
> So, must I understand that, in case I don't set a custom buffer (this
> is, I do not call to BIO_set_mem_buf(), then the internal buffer of my
> BIO will be freed when I call free(my_bio)?
> 

You should not call free directly. Instead you should use BIO_free. As
long as you do that and as long as you haven't called BIO_set_close with
BIO_NOCLOSE (or BIO_set_mem_buf as above), then the internal buffer will
be freed.

Matt    
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           majord...@openssl.org

Reply via email to