diff options
author | tb <> | 2021-12-29 23:02:52 +0000 |
---|---|---|
committer | tb <> | 2021-12-29 23:02:52 +0000 |
commit | 668b68ba481c2773347c48dd3d30918030a79c9c (patch) | |
tree | 21956f855fcf5c7a45025afc12753c133d8374c3 | |
parent | 1070f2fba37df08640bb6c8b4a9bbe8ac77bcb8a (diff) | |
download | openbsd-668b68ba481c2773347c48dd3d30918030a79c9c.tar.gz openbsd-668b68ba481c2773347c48dd3d30918030a79c9c.tar.bz2 openbsd-668b68ba481c2773347c48dd3d30918030a79c9c.zip |
Plug memleak
CID 345156
-rw-r--r-- | src/regress/lib/libcrypto/x509/constraints.c | 9 |
1 files 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) | |||
331 | } | 331 | } |
332 | 332 | ||
333 | static int | 333 | static int |
334 | test_invalid_uri(void) { | 334 | test_invalid_uri(void) |
335 | { | ||
335 | int j, failure=0; | 336 | int j, failure=0; |
336 | char *hostpart; | 337 | char *hostpart = NULL; |
338 | |||
337 | for (j = 0; invaliduri[j] != NULL; j++) { | 339 | for (j = 0; invaliduri[j] != NULL; j++) { |
338 | if (x509_constraints_uri_host(invaliduri[j], | 340 | if (x509_constraints_uri_host(invaliduri[j], |
339 | strlen(invaliduri[j]), &hostpart) != 0) { | 341 | strlen(invaliduri[j]), &hostpart) != 0) { |
@@ -342,7 +344,10 @@ test_invalid_uri(void) { | |||
342 | failure = 1; | 344 | failure = 1; |
343 | goto done; | 345 | goto done; |
344 | } | 346 | } |
347 | free(hostpart); | ||
348 | hostpart = NULL; | ||
345 | } | 349 | } |
350 | |||
346 | done: | 351 | done: |
347 | return failure; | 352 | return failure; |
348 | } | 353 | } |