Skip to content
Snippets Groups Projects
Commit efc6e234 authored by Deucе's avatar Deucе :ok_hand_tone4:
Browse files

Fix double-unlock and add code for impoosible situation

parent ccd73340
No related branches found
No related tags found
No related merge requests found
Pipeline #6089 passed
......@@ -555,6 +555,10 @@ add_public_key(void *vpriv)
pthread_mutex_unlock(&ssh_mutex);
cryptlib_error_message(status, "getting new channel");
}
else if (new_sftp_channel == -1) { // Shouldn't be possible...
sftp_channel = new_sftp_channel = -1;
pthread_mutex_unlock(&ssh_mutex);
}
}
}
}
......@@ -656,7 +660,6 @@ add_public_key(void *vpriv)
close_sftp_channel(new_sftp_channel);
}
else {
pthread_mutex_unlock(&ssh_mutex);
pthread_mutex_unlock(&ssh_tx_mutex);
}
free(priv);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment