From b7c8f993004c941ffee1e84f6eaf91012e93da47 Mon Sep 17 00:00:00 2001 From: ValdikSS Date: Fri, 20 Nov 2015 21:24:38 +0300 Subject: [PATCH] Join authentication thread only if it was created (if not in accounting only mode) This caused plugin (and OpenVPN) crash while terminating if radiusplugin is configured in accounting only mode and there are clients connected. --- radiusplugin.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/radiusplugin.cpp b/radiusplugin.cpp index aa04244..2cc076f 100755 --- a/radiusplugin.cpp +++ b/radiusplugin.cpp @@ -706,7 +706,8 @@ extern "C" //wait for the thread to exit - pthread_join(*context->getThread(),NULL); + if (context->conf.getAccountingOnly()==false) + pthread_join(*context->getThread(),NULL); pthread_cond_destroy(context->getCondSend( )); pthread_cond_destroy(context->getCondRecv( )); pthread_mutex_destroy(context->getMutexSend());