From 686c3bd4ac259f91100fafc79b50895d3c7336fa Mon Sep 17 00:00:00 2001 From: miod <> Date: Sun, 5 Oct 2014 18:26:43 +0000 Subject: Missing deallocation upon error. ok deraadt@ guenther@ --- src/lib/libcrypto/x509v3/v3_conf.c | 5 +++-- src/lib/libssl/src/crypto/x509v3/v3_conf.c | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'src') 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 @@ -/* $OpenBSD: v3_conf.c,v 1.15 2014/07/11 08:44:49 jsing Exp $ */ +/* $OpenBSD: v3_conf.c,v 1.16 2014/10/05 18:26:43 miod Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 1999. */ @@ -184,7 +184,7 @@ do_ext_i2d(const X509V3_EXT_METHOD *method, int ext_nid, int crit, { unsigned char *ext_der; int ext_len; - ASN1_OCTET_STRING *ext_oct; + ASN1_OCTET_STRING *ext_oct = NULL; X509_EXTENSION *ext; /* Convert internal representation to DER */ @@ -215,6 +215,7 @@ do_ext_i2d(const X509V3_EXT_METHOD *method, int ext_nid, int crit, return ext; merr: + M_ASN1_OCTET_STRING_free(ext_oct); X509V3err(X509V3_F_DO_EXT_I2D, ERR_R_MALLOC_FAILURE); return NULL; 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 @@ -/* $OpenBSD: v3_conf.c,v 1.15 2014/07/11 08:44:49 jsing Exp $ */ +/* $OpenBSD: v3_conf.c,v 1.16 2014/10/05 18:26:43 miod Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 1999. */ @@ -184,7 +184,7 @@ do_ext_i2d(const X509V3_EXT_METHOD *method, int ext_nid, int crit, { unsigned char *ext_der; int ext_len; - ASN1_OCTET_STRING *ext_oct; + ASN1_OCTET_STRING *ext_oct = NULL; X509_EXTENSION *ext; /* Convert internal representation to DER */ @@ -215,6 +215,7 @@ do_ext_i2d(const X509V3_EXT_METHOD *method, int ext_nid, int crit, return ext; merr: + M_ASN1_OCTET_STRING_free(ext_oct); X509V3err(X509V3_F_DO_EXT_I2D, ERR_R_MALLOC_FAILURE); return NULL; -- cgit v1.2.3-55-g6feb