capmt_flush_queue(capmt, 1);
free(capmt->capmt_id);
+ free(capmt->capmt_sockfile);
+ free(capmt->capmt_comment);
free(capmt);
return NULL;
TAILQ_REMOVE(&capmts, capmt, capmt_link);
capmt->capmt_running = 0;
pthread_cond_signal(&capmt->capmt_cond);
- pthread_mutex_unlock(&global_lock);
- pthread_join(capmt->capmt_tid, NULL);
- free(capmt->capmt_sockfile);
- capmt->capmt_sockfile = NULL;
- free(capmt->capmt_comment);
- capmt->capmt_comment = NULL;
tvhlog(LOG_INFO, "capmt", "mode %i %s %s port %i destroyed",
capmt->capmt_oscam,
capmt->capmt_oscam == CAPMT_OSCAM_TCP ? "IP address" : "sockfile",
capmt->capmt_sockfile, capmt->capmt_port);
+ pthread_mutex_unlock(&global_lock);
+ pthread_join(capmt->capmt_tid, NULL);
pthread_mutex_lock(&global_lock);
}