예제 #1
0
파일: core.c 프로젝트: Zentific/libvmi
status_t
vmi_destroy(
    vmi_instance_t vmi)
{
    if (!vmi)
        return VMI_FAILURE;

    vmi->shutting_down = TRUE;
    if(vmi->init_mode & VMI_INIT_EVENTS){
        events_destroy(vmi);
    }
    driver_destroy(vmi);
    if (vmi->os_interface) {
        os_destroy(vmi);
    }
    if (vmi->os_data) {
        free(vmi->os_data);
    }
    if (vmi->arch_interface) {
        free(vmi->arch_interface);
    }
    vmi->os_data = NULL;
    pid_cache_destroy(vmi);
    sym_cache_destroy(vmi);
    rva_cache_destroy(vmi);
    v2p_cache_destroy(vmi);
#if ENABLE_SHM_SNAPSHOT == 1
    v2m_cache_destroy(vmi);
#endif
    memory_cache_destroy(vmi);
    if (vmi->image_type)
        free(vmi->image_type);
    free(vmi);
    return VMI_SUCCESS;
}
예제 #2
0
/**
 * ca_context_destroy:
 * @c: the context to destroy.
 *
 * Destroy a (connected or unconnected) context object.
 *
 * Returns: 0 on success, negative error code on error.
 */
int ca_context_destroy(ca_context *c) {
    int ret = CA_SUCCESS;

    ca_return_val_if_fail(!ca_detect_fork(), CA_ERROR_FORKED);
    ca_return_val_if_fail(c, CA_ERROR_INVALID);

    /* There's no locking necessary here, because the application is
     * broken anyway if it destructs this object in one thread and
     * still is calling a method of it in another. */

    if (c->opened)
        ret = driver_destroy(c);

    if (c->props)
        ca_assert_se(ca_proplist_destroy(c->props) == CA_SUCCESS);

    if (c->mutex)
        ca_mutex_free(c->mutex);

    ca_free(c->driver);
    ca_free(c->device);
    ca_free(c);

    return ret;
}
예제 #3
0
파일: vtx_tcp.c 프로젝트: imatix/vtx
void vtx_tcp_driver (void *args, zctx_t *ctx, void *pipe)
{
    //  Create driver instance
    driver_t *driver = driver_new (ctx, pipe);
    char *verbose = zstr_recv (pipe);
    driver->verbose = atoi (verbose);
    free (verbose);
    zloop_set_verbose (driver->loop, driver->verbose);
    //  Run reactor until we exit from failure or interrupt
    zloop_start (driver->loop);
    //  Destroy driver instance
    driver_destroy (&driver);
}
예제 #4
0
파일: session.c 프로젝트: EricSB/dnscat2
void session_destroy(session_t *session)
{
  if(!session->is_shutdown)
    session_kill(session);

  if(session->name)
    safe_free(session->name);

  if(session->driver)
    driver_destroy(session->driver);

  if(session->outgoing_buffer)
    buffer_destroy(session->outgoing_buffer);

  safe_free(session);
}
예제 #5
0
파일: core.c 프로젝트: adrianlshaw/libvmi
status_t
vmi_destroy(
    vmi_instance_t vmi)
{
    vmi->shutting_down = TRUE;
    if(vmi->init_mode & VMI_INIT_EVENTS){
        events_destroy(vmi);
    }
    driver_destroy(vmi);
    pid_cache_destroy(vmi);
    sym_cache_destroy(vmi);
    rva_cache_destroy(vmi);
    v2p_cache_destroy(vmi);
    memory_cache_destroy(vmi);
    if (vmi->sysmap)
        free(vmi->sysmap);
    if (vmi->image_type)
        free(vmi->image_type);
    if (vmi)
        free(vmi);
    return VMI_SUCCESS;
}