Skip to content

Commit cc93fb1

Browse files
olszomalmtrojnar
authored andcommitted
Fix memory leak by freeing token fields before deallocation, CID 456029, 456030, 456031, 456032
1 parent 5b9b5e4 commit cc93fb1

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/util_uri.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -727,6 +727,10 @@ static int parse_pkcs11_uri(UTIL_CTX *ctx,
727727
*label = newlabel;
728728
*p_tok = tok;
729729
} else {
730+
OPENSSL_free(tok->model);
731+
OPENSSL_free(tok->manufacturer);
732+
OPENSSL_free(tok->serialnr);
733+
OPENSSL_free(tok->label);
730734
OPENSSL_free(tok);
731735
tok = NULL;
732736
OPENSSL_free(newlabel);

0 commit comments

Comments
 (0)