hcrypto: Fix leaks in test_rsa.c
This commit is contained in:
@@ -292,6 +292,7 @@ main(int argc, char **argv)
|
|||||||
|
|
||||||
if (RSA_generate_key_ex(rsa, 1024, e, NULL) != 1)
|
if (RSA_generate_key_ex(rsa, 1024, e, NULL) != 1)
|
||||||
errx(1, "RSA_generate_key_ex");
|
errx(1, "RSA_generate_key_ex");
|
||||||
|
BN_free(e);
|
||||||
} else {
|
} else {
|
||||||
rsa = read_key(engine, time_key);
|
rsa = read_key(engine, time_key);
|
||||||
}
|
}
|
||||||
@@ -314,6 +315,7 @@ main(int argc, char **argv)
|
|||||||
RSA_free(rsa);
|
RSA_free(rsa);
|
||||||
ENGINE_finish(engine);
|
ENGINE_finish(engine);
|
||||||
|
|
||||||
|
free(p);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user