Free all libcrypto global state memory before returning
authorjob <job@openbsd.org>
Fri, 28 Apr 2023 18:32:40 +0000 (18:32 +0000)
committerjob <job@openbsd.org>
Fri, 28 Apr 2023 18:32:40 +0000 (18:32 +0000)
Found with the help of Otto's malloc memory leak detector!

regress/lib/libcrypto/x509/x509_asn1.c

index 13054cd..402fd7f 100644 (file)
@@ -1,4 +1,4 @@
-/* $OpenBSD: x509_asn1.c,v 1.13 2023/04/28 18:31:34 job Exp $ */
+/* $OpenBSD: x509_asn1.c,v 1.14 2023/04/28 18:32:40 job Exp $ */
 /*
  * Copyright (c) 2023 Job Snijders <job@openbsd.org>
  *
@@ -520,5 +520,7 @@ int main(void)
        failed |= test_x509_crl_setters();
        failed |= test_x509_req_setters();
 
+       OPENSSL_cleanup();
+
        return failed;
 }