Skip to content

Commit

Permalink
bsock: stop timer before return from function
Browse files Browse the repository at this point in the history
 Fixes #1123: Director can crash during TwoWay Authentication
  • Loading branch information
franku committed Oct 25, 2019
1 parent 975d673 commit 5a92516
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion core/src/lib/bsock.cc
Expand Up @@ -384,7 +384,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) {
Expand Down

0 comments on commit 5a92516

Please sign in to comment.