summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authormiod <>2014-10-05 18:26:43 +0000
committermiod <>2014-10-05 18:26:43 +0000
commit686c3bd4ac259f91100fafc79b50895d3c7336fa (patch)
treec53f16316b0164f0a345ffc9aafc8cf458124903 /src/lib
parent09bcc7856a09ba5b54ed82a68820b171edafeda9 (diff)
downloadopenbsd-686c3bd4ac259f91100fafc79b50895d3c7336fa.tar.gz
openbsd-686c3bd4ac259f91100fafc79b50895d3c7336fa.tar.bz2
openbsd-686c3bd4ac259f91100fafc79b50895d3c7336fa.zip
Missing deallocation upon error.
ok deraadt@ guenther@
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/libcrypto/x509v3/v3_conf.c5
-rw-r--r--src/lib/libssl/src/crypto/x509v3/v3_conf.c5
2 files changed, 6 insertions, 4 deletions
diff --git a/src/lib/libcrypto/x509v3/v3_conf.c b/src/lib/libcrypto/x509v3/v3_conf.c
index c25e75c23b..08b9970efb 100644
--- a/src/lib/libcrypto/x509v3/v3_conf.c
+++ b/src/lib/libcrypto/x509v3/v3_conf.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: v3_conf.c,v 1.15 2014/07/11 08:44:49 jsing Exp $ */ 1/* $OpenBSD: v3_conf.c,v 1.16 2014/10/05 18:26:43 miod Exp $ */
2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL 2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
3 * project 1999. 3 * project 1999.
4 */ 4 */
@@ -184,7 +184,7 @@ do_ext_i2d(const X509V3_EXT_METHOD *method, int ext_nid, int crit,
184{ 184{
185 unsigned char *ext_der; 185 unsigned char *ext_der;
186 int ext_len; 186 int ext_len;
187 ASN1_OCTET_STRING *ext_oct; 187 ASN1_OCTET_STRING *ext_oct = NULL;
188 X509_EXTENSION *ext; 188 X509_EXTENSION *ext;
189 189
190 /* Convert internal representation to DER */ 190 /* Convert internal representation to DER */
@@ -215,6 +215,7 @@ do_ext_i2d(const X509V3_EXT_METHOD *method, int ext_nid, int crit,
215 return ext; 215 return ext;
216 216
217merr: 217merr:
218 M_ASN1_OCTET_STRING_free(ext_oct);
218 X509V3err(X509V3_F_DO_EXT_I2D, ERR_R_MALLOC_FAILURE); 219 X509V3err(X509V3_F_DO_EXT_I2D, ERR_R_MALLOC_FAILURE);
219 return NULL; 220 return NULL;
220 221
diff --git a/src/lib/libssl/src/crypto/x509v3/v3_conf.c b/src/lib/libssl/src/crypto/x509v3/v3_conf.c
index c25e75c23b..08b9970efb 100644
--- a/src/lib/libssl/src/crypto/x509v3/v3_conf.c
+++ b/src/lib/libssl/src/crypto/x509v3/v3_conf.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: v3_conf.c,v 1.15 2014/07/11 08:44:49 jsing Exp $ */ 1/* $OpenBSD: v3_conf.c,v 1.16 2014/10/05 18:26:43 miod Exp $ */
2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL 2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
3 * project 1999. 3 * project 1999.
4 */ 4 */
@@ -184,7 +184,7 @@ do_ext_i2d(const X509V3_EXT_METHOD *method, int ext_nid, int crit,
184{ 184{
185 unsigned char *ext_der; 185 unsigned char *ext_der;
186 int ext_len; 186 int ext_len;
187 ASN1_OCTET_STRING *ext_oct; 187 ASN1_OCTET_STRING *ext_oct = NULL;
188 X509_EXTENSION *ext; 188 X509_EXTENSION *ext;
189 189
190 /* Convert internal representation to DER */ 190 /* Convert internal representation to DER */
@@ -215,6 +215,7 @@ do_ext_i2d(const X509V3_EXT_METHOD *method, int ext_nid, int crit,
215 return ext; 215 return ext;
216 216
217merr: 217merr:
218 M_ASN1_OCTET_STRING_free(ext_oct);
218 X509V3err(X509V3_F_DO_EXT_I2D, ERR_R_MALLOC_FAILURE); 219 X509V3err(X509V3_F_DO_EXT_I2D, ERR_R_MALLOC_FAILURE);
219 return NULL; 220 return NULL;
220 221