From: tb Date: Wed, 29 Dec 2021 23:02:52 +0000 (+0000) Subject: Plug memleak X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=83d21318742204e2bd3e4af16e3ef9253ec4b454;p=openbsd Plug memleak CID 345156 --- diff --git a/regress/lib/libcrypto/x509/constraints.c b/regress/lib/libcrypto/x509/constraints.c index c4dedeb1fad..b552f30989a 100644 --- a/regress/lib/libcrypto/x509/constraints.c +++ b/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; }