From 668b68ba481c2773347c48dd3d30918030a79c9c Mon Sep 17 00:00:00 2001 From: tb <> Date: Wed, 29 Dec 2021 23:02:52 +0000 Subject: Plug memleak CID 345156 --- src/regress/lib/libcrypto/x509/constraints.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/regress/lib/libcrypto/x509/constraints.c b/src/regress/lib/libcrypto/x509/constraints.c index c4dedeb1fa..b552f30989 100644 --- a/src/regress/lib/libcrypto/x509/constraints.c +++ b/src/regress/lib/libcrypto/x509/constraints.c @@ -331,9 +331,11 @@ test_invalid_domain_constraints(void) } static int -test_invalid_uri(void) { +test_invalid_uri(void) +{ int j, failure=0; - char *hostpart; + char *hostpart = NULL; + for (j = 0; invaliduri[j] != NULL; j++) { if (x509_constraints_uri_host(invaliduri[j], strlen(invaliduri[j]), &hostpart) != 0) { @@ -342,7 +344,10 @@ test_invalid_uri(void) { failure = 1; goto done; } + free(hostpart); + hostpart = NULL; } + done: return failure; } -- cgit v1.2.3-55-g6feb