diff options
| author | miod <> | 2014-10-05 18:26:43 +0000 |
|---|---|---|
| committer | miod <> | 2014-10-05 18:26:43 +0000 |
| commit | 3e5593540c7030668e1be1a37e07e0e4ef995b1a (patch) | |
| tree | c53f16316b0164f0a345ffc9aafc8cf458124903 | |
| parent | 7e98f36c2d34b8a969bcbff232cb3dcc244e5acc (diff) | |
| download | openbsd-3e5593540c7030668e1be1a37e07e0e4ef995b1a.tar.gz openbsd-3e5593540c7030668e1be1a37e07e0e4ef995b1a.tar.bz2 openbsd-3e5593540c7030668e1be1a37e07e0e4ef995b1a.zip | |
Missing deallocation upon error.
ok deraadt@ guenther@
Diffstat (limited to '')
| -rw-r--r-- | src/lib/libcrypto/x509v3/v3_conf.c | 5 | ||||
| -rw-r--r-- | src/lib/libssl/src/crypto/x509v3/v3_conf.c | 5 |
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 | ||
| 217 | merr: | 217 | merr: |
| 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 | ||
| 217 | merr: | 217 | merr: |
| 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 | ||
