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

Fix double-unlock and add code for impoosible situation

parent d81ba4c7
Branches
Tags
1 merge request!455Update branch with changes from master
......@@ -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.
Please register or to comment