sc->single_worker = fr_worker_create(sc, el, "Worker", sc->log, sc->lvl, NULL);
if (!sc->single_worker) {
PERROR("Failed creating worker");
+ fr_network_destroy(sc->single_network);
goto pre_instantiate_st_fail;
}
if (sc->worker_thread_instantiate(sc->single_worker, el, subcs) < 0) {
PERROR("Failed calling thread instantiate");
+ destroy_both:
+ fr_network_destroy(sc->single_network);
+ fr_worker_destroy(sc->single_worker);
goto pre_instantiate_st_fail;
}
}
PERROR("Failed adding worker commands");
st_fail:
if (sc->worker_thread_detach) sc->worker_thread_detach(NULL);
- goto pre_instantiate_st_fail;
+ goto destroy_both;
}
if (fr_command_register_hook(NULL, "0", sc->single_network, cmd_network_table) < 0) {