提交 986dbbbe 编写于 作者: R Rob Percival 提交者: Matt Caswell

Prevent double-free of CTLOG public key

Previously, if ct_v1_log_id_from_pkey failed, public_key would be freed by
CTLOG_free at the end of the function, and then again by the caller (who
would assume ownership was not transferred when CTLOG_new returned NULL).
Reviewed-by: NRich Salz <rsalz@openssl.org>
Reviewed-by: NMatt Caswell <matt@openssl.org>
上级 cdb2a603
......@@ -247,10 +247,10 @@ CTLOG *CTLOG_new(EVP_PKEY *public_key, const char *name)
goto err;
}
ret->public_key = public_key;
if (ct_v1_log_id_from_pkey(public_key, ret->log_id) != 1)
goto err;
ret->public_key = public_key;
return ret;
err:
CTLOG_free(ret);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册