hcrypto: Fix leaks in test_rsa.c
authorNicolas Williams <nico@twosigma.com>
Mon, 27 Apr 2020 16:07:29 +0000 (11:07 -0500)
committerNicolas Williams <nico@twosigma.com>
Mon, 27 Apr 2020 18:14:21 +0000 (13:14 -0500)
lib/hcrypto/test_rsa.c

index 54b7a66c5ba1397e5cad30a109cb49069a148c1b..c9766b8b3727220bb1f5d651eb408abaeca63913 100644 (file)
@@ -292,6 +292,7 @@ main(int argc, char **argv)
 
            if (RSA_generate_key_ex(rsa, 1024, e, NULL) != 1)
                errx(1, "RSA_generate_key_ex");
+            BN_free(e);
        } else {
            rsa = read_key(engine, time_key);
        }
@@ -314,6 +315,7 @@ main(int argc, char **argv)
        RSA_free(rsa);
        ENGINE_finish(engine);
 
+        free(p);
        return 0;
     }