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

Move an sftp_state check inside mutex to silence Coverity.

There's still outstanding issues in Coverity around sftp_state and
sftp_channel that need some deep thought, but this one is trivial.
parent 5c2982f7
No related branches found
No related tags found
No related merge requests found
Pipeline #5875 passed
......@@ -605,14 +605,16 @@ add_public_key(void *vpriv)
}
sftp_channel = new_sftp_channel;
sftp_state = sftpc_begin(sftp_send, NULL);
pthread_mutex_unlock(&ssh_mutex);
pthread_mutex_unlock(&ssh_tx_mutex);
if (sftp_state == NULL) {
pthread_mutex_unlock(&ssh_mutex);
pthread_mutex_unlock(&ssh_tx_mutex);
close_sftp_channel(new_sftp_channel);
free(priv);
pubkey_thread_running = false;
return;
}
pthread_mutex_unlock(&ssh_mutex);
pthread_mutex_unlock(&ssh_tx_mutex);
if (sftpc_init(sftp_state)) {
sftp_filehandle_t f = NULL;
// TODO: Add permissions?
......
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