summaryrefslogtreecommitdiff
path: root/lib/libcrypto/asn1
diff options
context:
space:
mode:
authorTed Unangst <tedu@cvs.openbsd.org>2014-04-22 20:38:03 +0000
committerTed Unangst <tedu@cvs.openbsd.org>2014-04-22 20:38:03 +0000
commite6c54ceb8562dd50780798eaee178b31d9b68642 (patch)
tree2364a71ee0ea2e953d3f9a5ef205acdbb43a82ab /lib/libcrypto/asn1
parent6acfbd3a47399d057da11b11bc305c9d2d1ef92c (diff)
null a pointer to prevent double free. from Dirk Engling
Diffstat (limited to 'lib/libcrypto/asn1')
-rw-r--r--lib/libcrypto/asn1/a_bytes.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/libcrypto/asn1/a_bytes.c b/lib/libcrypto/asn1/a_bytes.c
index 34ed7b7db2b..6cc774e7828 100644
--- a/lib/libcrypto/asn1/a_bytes.c
+++ b/lib/libcrypto/asn1/a_bytes.c
@@ -205,6 +205,7 @@ d2i_ASN1_bytes(ASN1_STRING **a, const unsigned char **pp,
if ((ret->length < len) || (ret->data == NULL)) {
if (ret->data != NULL)
free(ret->data);
+ ret->data = NULL;
s = malloc(len + 1);
if (s == NULL) {
i = ERR_R_MALLOC_FAILURE;