boringssl/crypto/x509v3
David Benjamin a85093f5bb Fix error handling in X509_PURPOSE_add and X509_TRUST_add.
Two leaks can happen: if idx is -1, the newly allocated entry may not be freed.
Also, for X509_PURPOSE_add, if only one BUF_strdup succeeds, it will leak.

Restructure both so that the allocations happen ahead of time and are properly
cleaned up. This avoids leaving an existing entry in a half-broken state.

Found (sort of) by scan-build; because of all the indirections and DYNAMIC
flags, it doesn't actually realize the leak's been fixed.

Change-Id: I5521889bd14e007b3f62b6a4906d7c346698b48c
Reviewed-on: https://boringssl-review.googlesource.com/2209
Reviewed-by: Adam Langley <agl@google.com>
2014-11-06 01:44:43 +00:00
..
CMakeLists.txt Inital import. 2014-06-20 13:17:32 -07:00
ext_dat.h Inital import. 2014-06-20 13:17:32 -07:00
pcy_cache.c Inital import. 2014-06-20 13:17:32 -07:00
pcy_data.c Inital import. 2014-06-20 13:17:32 -07:00
pcy_int.h Inital import. 2014-06-20 13:17:32 -07:00
pcy_lib.c Inital import. 2014-06-20 13:17:32 -07:00
pcy_map.c Inital import. 2014-06-20 13:17:32 -07:00
pcy_node.c Inital import. 2014-06-20 13:17:32 -07:00
pcy_tree.c Add X509_up_ref and use it internally. 2014-08-07 00:06:34 +00:00
tabtest.c Add a CRYPTO_library_init and static-initializer-less build option. 2014-09-12 00:10:53 +00:00
v3_akey.c Inital import. 2014-06-20 13:17:32 -07:00
v3_akeya.c Inital import. 2014-06-20 13:17:32 -07:00
v3_alt.c Inital import. 2014-06-20 13:17:32 -07:00
v3_bcons.c Inital import. 2014-06-20 13:17:32 -07:00
v3_bitst.c Inital import. 2014-06-20 13:17:32 -07:00
v3_conf.c Inital import. 2014-06-20 13:17:32 -07:00
v3_cpols.c Inital import. 2014-06-20 13:17:32 -07:00
v3_crld.c Inital import. 2014-06-20 13:17:32 -07:00
v3_enum.c Inital import. 2014-06-20 13:17:32 -07:00
v3_extku.c Inital import. 2014-06-20 13:17:32 -07:00
v3_genn.c Inital import. 2014-06-20 13:17:32 -07:00
v3_ia5.c Remove CHARSET_EBCDIC 2014-07-07 19:30:35 +00:00
v3_info.c Inital import. 2014-06-20 13:17:32 -07:00
v3_int.c Inital import. 2014-06-20 13:17:32 -07:00
v3_lib.c Fix leak in X509V3_EXT_add on error. 2014-11-06 01:40:58 +00:00
v3_ncons.c Add OPENSSL_str[n]casecmp 2014-06-20 13:17:43 -07:00
v3_pci.c Inital import. 2014-06-20 13:17:32 -07:00
v3_pcia.c Inital import. 2014-06-20 13:17:32 -07:00
v3_pcons.c Inital import. 2014-06-20 13:17:32 -07:00
v3_pku.c Inital import. 2014-06-20 13:17:32 -07:00
v3_pmaps.c Inital import. 2014-06-20 13:17:32 -07:00
v3_prn.c Remove CHARSET_EBCDIC 2014-07-07 19:30:35 +00:00
v3_purp.c Fix error handling in X509_PURPOSE_add and X509_TRUST_add. 2014-11-06 01:44:43 +00:00
v3_skey.c Inital import. 2014-06-20 13:17:32 -07:00
v3_sxnet.c Inital import. 2014-06-20 13:17:32 -07:00
v3_utl.c Remove CHARSET_EBCDIC 2014-07-07 19:30:35 +00:00
v3nametest.c Fix standalone bio_test and v3name_test on Win64. 2014-10-29 21:17:27 +00:00
x509v3_error.c Move public headers to include/openssl/ 2014-07-14 22:42:18 +00:00