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: Rich Salz <rsalz@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
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);