_STACK *sk_new(int (*c) (const void *, const void *))
{
    _STACK *ret;

    if ((ret = OPENSSL_zalloc(sizeof(_STACK))) == 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);
}