mirror of
https://git.libssh.org/projects/libssh.git
synced 2025-08-10 06:23:01 +03:00
Add NULL check for agent_free().
git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/libssh/trunk@382 7dcaeef0-15fb-0310-b436-a5af3365683c
This commit is contained in:
@@ -136,6 +136,10 @@ AGENT *agent_new(struct ssh_session *session) {
|
||||
}
|
||||
|
||||
void agent_close(struct agent_struct *agent) {
|
||||
if (agent == NULL) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (getenv("SSH_AUTH_SOCK")) {
|
||||
ssh_socket_close(agent->sock);
|
||||
}
|
||||
|
Reference in New Issue
Block a user