Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/boringssl.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Benjamin <davidben@chromium.org>2014-11-03 00:02:45 +0300
committerAdam Langley <agl@google.com>2014-11-06 04:29:59 +0300
commit74072ac84cc3a56b380d2a617c4c8529313312ce (patch)
tree1468ff2f0ed2a3aefd92e74d3e2eb5a333787517 /crypto/asn1/f_enum.c
parent3f383908e2ee0268ac48de3f953a2f099614d74f (diff)
Fix a2i_ASN1_* leak on failure.
Caught by clang scan-build. Change-Id: I1097848052026361e24fd1202cc0c831c3f83e49 Reviewed-on: https://boringssl-review.googlesource.com/2201 Reviewed-by: Adam Langley <agl@google.com>
Diffstat (limited to 'crypto/asn1/f_enum.c')
-rw-r--r--crypto/asn1/f_enum.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/crypto/asn1/f_enum.c b/crypto/asn1/f_enum.c
index 57258244..530afe57 100644
--- a/crypto/asn1/f_enum.c
+++ b/crypto/asn1/f_enum.c
@@ -159,7 +159,6 @@ int a2i_ASN1_ENUMERATED(BIO *bp, ASN1_ENUMERATED *bs, char *buf, int size)
if (sp == NULL)
{
OPENSSL_PUT_ERROR(ASN1, a2i_ASN1_ENUMERATED, ERR_R_MALLOC_FAILURE);
- if (s != NULL) OPENSSL_free(s);
goto err;
}
s=sp;
@@ -200,6 +199,8 @@ err:
err_sl:
OPENSSL_PUT_ERROR(ASN1, a2i_ASN1_ENUMERATED, ASN1_R_SHORT_LINE);
}
+ if (s != NULL)
+ OPENSSL_free(s);
return(ret);
}