openssl/crypto
Corey Minyard c6048af23c 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)
2019-01-21 17:47:02 +10:00
..
aes Following the license change, modify the boilerplates in crypto/aes/ 2018-12-06 14:23:25 +01:00
aria Following the license change, modify the boilerplates in crypto/ 2018-12-06 15:32:17 +01:00
asn1 Update generator copyright year. 2019-01-07 14:01:58 -05:00
async Following the license change, modify the boilerplates in crypto/async/ 2018-12-06 14:25:47 +01:00
bf Following the license change, modify the boilerplates in crypto/bf/ 2018-12-06 14:27:41 +01:00
bio Fix a memory leak in the mem bio 2019-01-21 17:47:02 +10:00
blake2 Following the license change, modify the boilerplates in crypto/blake2/ 2018-12-06 14:30:07 +01:00
bn Reduce inputs before the RSAZ code. 2019-01-17 08:17:59 +10:00
buffer Following the license change, modify the boilerplates in crypto/buffer/ 2018-12-06 14:32:34 +01:00
camellia Following the license change, modify the boilerplates in crypto/camellia/ 2018-12-06 14:34:55 +01:00
cast Following the license change, modify the boilerplates in crypto/cast/ 2018-12-06 14:36:10 +01:00
chacha crypto/chacha/asm/chacha-s390x.pl: add vx code path. 2019-01-05 09:40:35 +01:00
cmac Following the license change, modify the boilerplates in crypto/cmac/ 2018-12-06 14:39:25 +01:00
cms Add missing OPENSSL_clear_free before using ec->key 2018-12-13 10:04:57 +00:00
comp Following the license change, modify the boilerplates in crypto/comp/ 2018-12-06 14:42:18 +01:00
conf More configurable crypto and ssl library initialization 2019-01-07 14:02:28 -05:00
ct Following the license change, modify the boilerplates in crypto/ct/ 2018-12-06 14:44:27 +01:00
des Fix compilation on sparc 2019-01-08 16:26:47 +00:00
dh Following the license change, modify the boilerplates in crypto/dh/ 2018-12-06 14:47:24 +01:00
dsa Following the license change, modify the boilerplates in crypto/dsa/ 2018-12-06 14:48:43 +01:00
dso Fix compilation with -DREF_PRINT 2019-01-13 18:30:38 +01:00
ec Fix compilation with -DREF_PRINT 2019-01-13 18:30:38 +01:00
engine Do not complain when /dev/crypto does not exist. 2018-12-23 00:07:13 +01:00
err More configurable crypto and ssl library initialization 2019-01-07 14:02:28 -05:00
evp Fix compilation on sparc 2019-01-08 16:26:47 +00:00
gmac Following the license change, modify the boilerplates in crypto/gmac/ 2018-12-06 15:00:48 +01:00
hmac Following the license change, modify the boilerplates in crypto/hmac/ 2018-12-06 15:01:38 +01:00
idea Following the license change, modify the boilerplates in crypto/idea/ 2018-12-06 14:56:39 +01:00
include/internal Following the license change, modify the boilerplates in include/ and crypto/include/ 2018-12-06 15:57:31 +01:00
kdf Convert tls1_prf_P_hash to use the EVP_MAC interface 2018-12-15 12:53:16 +01:00
kmac Update kmac.c 2018-12-08 11:00:18 +01:00
lhash Following the license change, modify the boilerplates in crypto/lhash/ 2018-12-06 15:02:41 +01:00
md2 Following the license change, modify the boilerplates in crypto/mdN/ 2018-12-06 15:04:11 +01:00
md4 Following the license change, modify the boilerplates in crypto/mdN/ 2018-12-06 15:04:11 +01:00
md5 Following the license change, modify the boilerplates in crypto/mdN/ 2018-12-06 15:04:11 +01:00
mdc2 Following the license change, modify the boilerplates in crypto/mdc2/ 2018-12-06 15:04:57 +01:00
modes Fixes #7879: AES-SIV to use EVP_MAC APIs 2018-12-13 11:09:15 -05:00
objects Update generator copyright year. 2019-01-07 14:01:58 -05:00
ocsp Following the license change, modify the boilerplates in crypto/ocsp/ 2018-12-06 15:08:20 +01:00
pem Following the license change, modify the boilerplates in crypto/pem/ 2018-12-06 15:09:09 +01:00
perlasm s390x assembly pack: perlasm support. 2019-01-05 09:38:40 +01:00
pkcs7 Following the license change, modify the boilerplates in crypto/pkcs7/ 2018-12-06 15:12:24 +01:00
pkcs12 Following the license change, modify the boilerplates in crypto/pkcs12/ 2018-12-06 15:11:42 +01:00
poly1305 Following the license change, modify the boilerplates in crypto/poly1305/ 2018-12-06 15:13:16 +01:00
rand Following the license change, modify the boilerplates in crypto/rand/ 2018-12-06 15:14:05 +01:00
rc2 Following the license change, modify the boilerplates in crypto/rcN/ 2018-12-06 15:14:57 +01:00
rc4 Following the license change, modify the boilerplates in crypto/rcN/ 2018-12-06 15:14:57 +01:00
rc5 Following the license change, modify the boilerplates in crypto/rcN/ 2018-12-06 15:14:57 +01:00
ripemd Following the license change, modify the boilerplates in crypto/ripemd/ 2018-12-06 15:15:42 +01:00
rsa Fix cert with rsa instead of rsaEncryption as public key algorithm 2018-12-31 09:47:12 +01:00
seed Following the license change, modify the boilerplates in crypto/seed/ 2018-12-06 15:22:15 +01:00
sha Following the license change, modify the boilerplates in crypto/sha/ 2018-12-06 15:23:03 +01:00
siphash Following the license change, modify the boilerplates in crypto/siphash/ 2018-12-06 15:24:02 +01:00
sm2 Following the license change, modify the boilerplates in crypto/smN/ 2018-12-06 15:24:52 +01:00
sm3 Following the license change, modify the boilerplates in crypto/smN/ 2018-12-06 15:24:52 +01:00
sm4 Following the license change, modify the boilerplates in crypto/smN/ 2018-12-06 15:24:52 +01:00
srp Check more return values in the SRP code 2019-01-15 11:29:40 +00:00
stack Following the license change, modify the boilerplates in crypto/stack/ 2018-12-06 15:26:59 +01:00
store Following the license change, modify the boilerplates in crypto/store/ 2018-12-06 15:27:43 +01:00
ts Following the license change, modify the boilerplates in crypto/ts/ 2018-12-06 15:28:35 +01:00
txt_db Following the license change, modify the boilerplates in crypto/ 2018-12-06 15:32:17 +01:00
ui Following the license change, modify the boilerplates in crypto/ui/ 2018-12-06 15:31:37 +01:00
whrlpool Following the license change, modify the boilerplates in crypto/whrlpool/ 2018-12-06 15:29:22 +01:00
x509 Fix compilation with -DREF_PRINT 2019-01-13 18:30:38 +01:00
x509v3 X509_check_issued: check that signature algo matches signing key algo 2018-12-19 13:33:54 +01:00
alphacpuid.pl Following the license change, modify the boilerplates in crypto/ 2018-12-06 15:32:17 +01:00
arm64cpuid.pl Following the license change, modify the boilerplates in crypto/ 2018-12-06 15:32:17 +01:00
arm_arch.h Following the license change, modify the boilerplates in crypto/ 2018-12-06 15:32:17 +01:00
armcap.c crypto/armcap.c, crypto/ppccap.c: stricter use of getauxval() 2019-01-16 18:00:48 +01:00
armv4cpuid.pl Following the license change, modify the boilerplates in crypto/ 2018-12-06 15:32:17 +01:00
build.info KMAC implementation using EVP_MAC 2018-11-14 07:01:09 +10:00
c64xpluscpuid.pl Following the license change, modify the boilerplates in crypto/ 2018-12-06 15:32:17 +01:00
cpt_err.c Following the license change, modify the boilerplates in crypto/ 2018-12-06 15:32:17 +01:00
cryptlib.c Following the license change, modify the boilerplates in crypto/ 2018-12-06 15:32:17 +01:00
ctype.c Following the license change, modify the boilerplates in crypto/ 2018-12-06 15:32:17 +01:00
cversion.c Following the license change, modify the boilerplates in crypto/ 2018-12-06 15:32:17 +01:00
dllmain.c Following the license change, modify the boilerplates in crypto/ 2018-12-06 15:32:17 +01:00
ebcdic.c Following the license change, modify the boilerplates in crypto/ 2018-12-06 15:32:17 +01:00
ex_data.c Following the license change, modify the boilerplates in crypto/ 2018-12-06 15:32:17 +01:00
getenv.c Following the license change, modify the boilerplates in crypto/ 2018-12-06 15:32:17 +01:00
ia64cpuid.S Following the license change, modify the boilerplates in crypto/ 2018-12-06 15:32:17 +01:00
init.c More configurable crypto and ssl library initialization 2019-01-07 14:02:28 -05:00
LPdir_nyi.c Following the license change, modify the boilerplates in crypto/ 2018-12-06 15:32:17 +01:00
LPdir_unix.c Following the license change, modify the boilerplates in crypto/ 2018-12-06 15:32:17 +01:00
LPdir_vms.c Following the license change, modify the boilerplates in crypto/ 2018-12-06 15:32:17 +01:00
LPdir_win.c Following the license change, modify the boilerplates in crypto/ 2018-12-06 15:32:17 +01:00
LPdir_win32.c Following the license change, modify the boilerplates in crypto/ 2018-12-06 15:32:17 +01:00
LPdir_wince.c Following the license change, modify the boilerplates in crypto/ 2018-12-06 15:32:17 +01:00
mem.c Following the license change, modify the boilerplates in crypto/ 2018-12-06 15:32:17 +01:00
mem_clr.c Following the license change, modify the boilerplates in crypto/ 2018-12-06 15:32:17 +01:00
mem_dbg.c Following the license change, modify the boilerplates in crypto/ 2018-12-06 15:32:17 +01:00
mem_sec.c Following the license change, modify the boilerplates in crypto/ 2018-12-06 15:32:17 +01:00
mips_arch.h Following the license change, modify the boilerplates in crypto/ 2018-12-06 15:32:17 +01:00
o_dir.c Following the license change, modify the boilerplates in crypto/ 2018-12-06 15:32:17 +01:00
o_fips.c Following the license change, modify the boilerplates in crypto/ 2018-12-06 15:32:17 +01:00
o_fopen.c Following the license change, modify the boilerplates in crypto/ 2018-12-06 15:32:17 +01:00
o_init.c Following the license change, modify the boilerplates in crypto/ 2018-12-06 15:32:17 +01:00
o_str.c Following the license change, modify the boilerplates in crypto/ 2018-12-06 15:32:17 +01:00
o_time.c Following the license change, modify the boilerplates in crypto/ 2018-12-06 15:32:17 +01:00
pariscid.pl Following the license change, modify the boilerplates in crypto/ 2018-12-06 15:32:17 +01:00
ppc_arch.h Following the license change, modify the boilerplates in crypto/ 2018-12-06 15:32:17 +01:00
ppccap.c crypto/armcap.c, crypto/ppccap.c: stricter use of getauxval() 2019-01-16 18:00:48 +01:00
ppccpuid.pl Following the license change, modify the boilerplates in crypto/ 2018-12-06 15:32:17 +01:00
s390x_arch.h Following the license change, modify the boilerplates in crypto/ 2018-12-06 15:32:17 +01:00
s390xcap.c Following the license change, modify the boilerplates in crypto/ 2018-12-06 15:32:17 +01:00
s390xcpuid.pl Following the license change, modify the boilerplates in crypto/ 2018-12-06 15:32:17 +01:00
sparc_arch.h Following the license change, modify the boilerplates in crypto/ 2018-12-06 15:32:17 +01:00
sparccpuid.S Following the license change, modify the boilerplates in crypto/ 2018-12-06 15:32:17 +01:00
sparcv9cap.c Following the license change, modify the boilerplates in crypto/ 2018-12-06 15:32:17 +01:00
threads_none.c Following the license change, modify the boilerplates in crypto/ 2018-12-06 15:32:17 +01:00
threads_pthread.c Following the license change, modify the boilerplates in crypto/ 2018-12-06 15:32:17 +01:00
threads_win.c Following the license change, modify the boilerplates in crypto/ 2018-12-06 15:32:17 +01:00
uid.c crypto/uid.c: use own macro as guard rather than AT_SECURE 2019-01-16 06:19:17 +01:00
vms_rms.h Following the license change, modify the boilerplates in crypto/ 2018-12-06 15:32:17 +01:00
x86_64cpuid.pl Following the license change, modify the boilerplates in crypto/ 2018-12-06 15:32:17 +01:00
x86cpuid.pl Following the license change, modify the boilerplates in crypto/ 2018-12-06 15:32:17 +01:00