summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorbeck <beck@openbsd.org>2014-04-23 04:33:10 +0000
committerbeck <beck@openbsd.org>2014-04-23 04:33:10 +0000
commit9c336a09a338b4153156a3a4d9eae218b4276499 (patch)
treefd76e508f1cb4fda57db6d2cdd8a013209b06521 /lib
parentRather than sprinkling magical numbers everywhere, we can use sizeof() (diff)
downloadwireguard-openbsd-9c336a09a338b4153156a3a4d9eae218b4276499.tar.xz
wireguard-openbsd-9c336a09a338b4153156a3a4d9eae218b4276499.zip
Make sure ret->name is NULL'ed before return when freeing.
from Dirk Engling <erdgeist@erdgeist.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/libcrypto/asn1/x_x509.c1
-rw-r--r--lib/libssl/src/crypto/asn1/x_x509.c1
2 files changed, 2 insertions, 0 deletions
diff --git a/lib/libcrypto/asn1/x_x509.c b/lib/libcrypto/asn1/x_x509.c
index e7d613e20f5..e93d97d2c41 100644
--- a/lib/libcrypto/asn1/x_x509.c
+++ b/lib/libcrypto/asn1/x_x509.c
@@ -125,6 +125,7 @@ x509_cb(int operation, ASN1_VALUE **pval, const ASN1_ITEM *it, void *exarg)
#endif
if (ret->name != NULL)
free(ret->name);
+ ret->name = NULL;
break;
}
diff --git a/lib/libssl/src/crypto/asn1/x_x509.c b/lib/libssl/src/crypto/asn1/x_x509.c
index e7d613e20f5..e93d97d2c41 100644
--- a/lib/libssl/src/crypto/asn1/x_x509.c
+++ b/lib/libssl/src/crypto/asn1/x_x509.c
@@ -125,6 +125,7 @@ x509_cb(int operation, ASN1_VALUE **pval, const ASN1_ITEM *it, void *exarg)
#endif
if (ret->name != NULL)
free(ret->name);
+ ret->name = NULL;
break;
}