OPENSSL_STACK *OPENSSL_sk_new(OPENSSL_sk_compfunc c)
{
    OPENSSL_STACK *ret;

    if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL)
        goto err;
    if ((ret->data = OPENSSL_zalloc(sizeof(*ret->data) * min_nodes)) == NULL)
        goto err;
    ret->comp = c;
    ret->num_alloc = min_nodes;
    return (ret);

 err:
    OPENSSL_free(ret);
    return (NULL);
}