openssl/crypto/bio
Corey Minyard 492f70645c Fix a memory leak in the mem bio
If you use a BIO and set up your own buffer that is not freed, the
memory bio will leak the BIO_BUF_MEM object it allocates.

The trouble is that the BIO_BUF_MEM is allocated and kept around,
but it is not freed if BIO_NOCLOSE is set.

The freeing of BIO_BUF_MEM was fairly confusing, simplify things
so mem_buf_free only frees the memory buffer and free the BIO_BUF_MEM
in mem_free(), where it should be done.

Alse add a test for a leak in the memory bio
Setting a memory buffer caused a leak.

Signed-off-by: Corey Minyard <minyard@acm.org>

Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de>
Reviewed-by: Paul Dale <paul.dale@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/8051)

(cherry picked from commit c6048af23c)
2019-01-21 17:50:04 +10:00
..
b_addr.c Ensure the thread keys are always allocated in the same order 2018-04-20 15:45:06 +02:00
b_dump.c Update copyright year 2018-02-13 13:59:25 +00:00
b_print.c Update copyright year 2018-04-17 15:18:40 +02:00
b_sock.c Use get_last_sys_error() instead of get_last_rtl_error() 2018-04-26 15:01:16 +02:00
b_sock2.c minor fixes for Windows 2018-09-12 09:18:25 +02:00
bf_buff.c Fix invalid function type casts. 2017-12-15 19:33:48 +01:00
bf_lbuf.c Set error code on alloc failures 2018-04-03 11:31:16 -04:00
bf_nbio.c Add missing error code when alloc-return-null 2018-04-26 12:27:46 -04:00
bf_null.c Update copyright year 2018-02-13 13:59:25 +00:00
bio_cb.c BIO range checking. 2017-07-07 07:18:41 +10:00
bio_err.c Add missing error code when alloc-return-null 2018-04-26 12:27:46 -04:00
bio_lcl.h (Re)move some things from e_os.h 2017-08-22 14:15:40 -04:00
bio_lib.c Fix the BIO callback return code handling 2018-10-04 14:20:27 +01:00
bio_meth.c Use void in all function definitions that do not take any arguments 2018-05-11 14:37:48 +02:00
bss_acpt.c Add missing error code when alloc-return-null 2018-04-26 12:27:46 -04:00
bss_bio.c Move e_os.h to be the very first include. 2017-08-30 07:20:44 +10:00
bss_conn.c Add missing error code when alloc-return-null 2018-04-26 12:27:46 -04:00
bss_dgram.c bio/bss_dgram.c: harmonize usage of OPENSSL_USE_IPV6 with the rest. 2018-07-20 13:40:27 +02:00
bss_fd.c Add comments to NULL func ptrs in bio_method_st 2017-12-18 07:04:48 +10:00
bss_file.c Add comments to NULL func ptrs in bio_method_st 2017-12-18 07:04:48 +10:00
bss_log.c Small cleanup (util/mkdef.pl, crypto/bio/bss_log.c, include/openssl/ocsp.h) 2018-10-04 09:59:00 +02:00
bss_mem.c Fix a memory leak in the mem bio 2019-01-21 17:50:04 +10:00
bss_null.c Update copyright year 2018-02-13 13:59:25 +00:00
bss_sock.c Add comments to NULL func ptrs in bio_method_st 2017-12-18 07:04:48 +10:00
build.info Adapt bf_lbuf for opaque BIO 2016-03-30 04:35:14 +02:00