diff --git a/core/src/lib/bsock.cc b/core/src/lib/bsock.cc index 77a83ec22c1..6af2f4333be 100644 --- a/core/src/lib/bsock.cc +++ b/core/src/lib/bsock.cc @@ -396,7 +396,10 @@ bool BareosSocket::TwoWayAuthenticate(JobControlRecord* jcr, btimer_t* tid = StartBsockTimer(this, AUTH_TIMEOUT); - if (ConnectionReceivedTerminateSignal()) { return false; } + if (ConnectionReceivedTerminateSignal()) { + if (tid) { StopBsockTimer(tid); } + return false; + } auth_success = cram_md5_handshake.DoHandshake(initiated_by_remote); if (!auth_success) {