diff options
| -rw-r--r-- | src/lib/libcrypto/x509/x509_att.c | 8 | ||||
| -rw-r--r-- | src/lib/libssl/src/crypto/x509/x509_att.c | 8 | 
2 files changed, 12 insertions, 4 deletions
diff --git a/src/lib/libcrypto/x509/x509_att.c b/src/lib/libcrypto/x509/x509_att.c index f2668d189d..bbbeba50ac 100644 --- a/src/lib/libcrypto/x509/x509_att.c +++ b/src/lib/libcrypto/x509/x509_att.c  | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: x509_att.c,v 1.8 2014/06/12 15:49:31 deraadt Exp $ */ | 1 | /* $OpenBSD: x509_att.c,v 1.9 2014/06/28 18:25:24 logan Exp $ */ | 
| 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 
| 3 | * All rights reserved. | 3 | * All rights reserved. | 
| 4 | * | 4 | * | 
| @@ -333,8 +333,11 @@ X509_ATTRIBUTE_set1_data(X509_ATTRIBUTE *attr, int attrtype, const void *data, | |||
| 333 | * at least one value but some types use and zero length SET and | 333 | * at least one value but some types use and zero length SET and | 
| 334 | * require this. | 334 | * require this. | 
| 335 | */ | 335 | */ | 
| 336 | if (attrtype == 0) | 336 | if (attrtype == 0) { | 
| 337 | ASN1_STRING_free(stmp); | ||
| 337 | return 1; | 338 | return 1; | 
| 339 | } | ||
| 340 | |||
| 338 | if (!(ttmp = ASN1_TYPE_new())) | 341 | if (!(ttmp = ASN1_TYPE_new())) | 
| 339 | goto err; | 342 | goto err; | 
| 340 | if ((len == -1) && !(attrtype & MBSTRING_FLAG)) { | 343 | if ((len == -1) && !(attrtype & MBSTRING_FLAG)) { | 
| @@ -347,6 +350,7 @@ X509_ATTRIBUTE_set1_data(X509_ATTRIBUTE *attr, int attrtype, const void *data, | |||
| 347 | return 1; | 350 | return 1; | 
| 348 | 351 | ||
| 349 | err: | 352 | err: | 
| 353 | ASN1_STRING_free(stmp); | ||
| 350 | X509err(X509_F_X509_ATTRIBUTE_SET1_DATA, ERR_R_MALLOC_FAILURE); | 354 | X509err(X509_F_X509_ATTRIBUTE_SET1_DATA, ERR_R_MALLOC_FAILURE); | 
| 351 | return 0; | 355 | return 0; | 
| 352 | } | 356 | } | 
diff --git a/src/lib/libssl/src/crypto/x509/x509_att.c b/src/lib/libssl/src/crypto/x509/x509_att.c index f2668d189d..bbbeba50ac 100644 --- a/src/lib/libssl/src/crypto/x509/x509_att.c +++ b/src/lib/libssl/src/crypto/x509/x509_att.c  | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: x509_att.c,v 1.8 2014/06/12 15:49:31 deraadt Exp $ */ | 1 | /* $OpenBSD: x509_att.c,v 1.9 2014/06/28 18:25:24 logan Exp $ */ | 
| 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 
| 3 | * All rights reserved. | 3 | * All rights reserved. | 
| 4 | * | 4 | * | 
| @@ -333,8 +333,11 @@ X509_ATTRIBUTE_set1_data(X509_ATTRIBUTE *attr, int attrtype, const void *data, | |||
| 333 | * at least one value but some types use and zero length SET and | 333 | * at least one value but some types use and zero length SET and | 
| 334 | * require this. | 334 | * require this. | 
| 335 | */ | 335 | */ | 
| 336 | if (attrtype == 0) | 336 | if (attrtype == 0) { | 
| 337 | ASN1_STRING_free(stmp); | ||
| 337 | return 1; | 338 | return 1; | 
| 339 | } | ||
| 340 | |||
| 338 | if (!(ttmp = ASN1_TYPE_new())) | 341 | if (!(ttmp = ASN1_TYPE_new())) | 
| 339 | goto err; | 342 | goto err; | 
| 340 | if ((len == -1) && !(attrtype & MBSTRING_FLAG)) { | 343 | if ((len == -1) && !(attrtype & MBSTRING_FLAG)) { | 
| @@ -347,6 +350,7 @@ X509_ATTRIBUTE_set1_data(X509_ATTRIBUTE *attr, int attrtype, const void *data, | |||
| 347 | return 1; | 350 | return 1; | 
| 348 | 351 | ||
| 349 | err: | 352 | err: | 
| 353 | ASN1_STRING_free(stmp); | ||
| 350 | X509err(X509_F_X509_ATTRIBUTE_SET1_DATA, ERR_R_MALLOC_FAILURE); | 354 | X509err(X509_F_X509_ATTRIBUTE_SET1_DATA, ERR_R_MALLOC_FAILURE); | 
| 351 | return 0; | 355 | return 0; | 
| 352 | } | 356 | } | 
