提交 f6de4eb7 编写于 作者: D Dr. Stephen Henson

Fix memory leak and print out keygen errors.

Reviewed-by: NRich Salz <rsalz@openssl.org>
上级 f1f07a23
......@@ -462,11 +462,17 @@ int ecparam_main(int argc, char **argv)
assert(need_rand);
if (EC_KEY_set_group(eckey, group) == 0)
if (EC_KEY_set_group(eckey, group) == 0) {
BIO_printf(bio_err, "unable to set group when generating key\n");
EC_KEY_free(eckey);
ERR_print_errors(bio_err);
goto end;
}
if (!EC_KEY_generate_key(eckey)) {
BIO_printf(bio_err, "unable to generate key\n");
EC_KEY_free(eckey);
ERR_print_errors(bio_err);
goto end;
}
assert(private);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册