Clean up X509 memory before exit
authorjob <job@openbsd.org>
Wed, 26 Apr 2023 21:30:12 +0000 (21:30 +0000)
committerjob <job@openbsd.org>
Wed, 26 Apr 2023 21:30:12 +0000 (21:30 +0000)
regress/lib/libcrypto/x509/x509_asn1.c

index f41b26f..b6b251f 100644 (file)
@@ -1,4 +1,4 @@
-/* $OpenBSD: x509_asn1.c,v 1.7 2023/04/26 19:05:37 job Exp $ */
+/* $OpenBSD: x509_asn1.c,v 1.8 2023/04/26 21:30:12 job Exp $ */
 /*
  * Copyright (c) 2023 Job Snijders <job@openbsd.org>
  *
@@ -229,6 +229,9 @@ main(void)
        ret += x509_compare("X509_set_pubkey", a, der2, der2sz);
        x509_cleanup(&a, &der2);
 
+       X509_free(x);
+       free(der);
+
        if (ret)
                return 1;
        return 0;