Example #1
0
static void
test_regRemove(void)
{
    RegStatus   status;

    status = reg_remove();
    if (status) {
        log_error("test_regRemove(): Couldn't remove registry");
    }
    else {
        CU_ASSERT_EQUAL(status, 0);
    }
}
Example #2
0
// free the endpoint descriptor
static void tnp_do_free(endpoint_t *ep) {
        tn_endpoint_t *cep = (tn_endpoint_t*) ep;

        if (reg_size(&ep->files)) {
                log_warn("tcp_free(): trying to close endpoint %p with %d open files!\n",
                        ep, reg_size(&ep->files));
                return;
        }
        if (ep->is_assigned > 0) {
                log_warn("tcp_free(): trying to free endpoint %p still assigned\n", ep);
                return;
        }

        reg_remove(&endpoints, cep);

	mem_free(cep->hostname);
        mem_free(ep);
}