get_cert_by_subject: check for NULL when allocating hent