mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-09 09:54:25 +09: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) {
|
void agent_close(struct agent_struct *agent) {
|
||||||
|
if (agent == NULL) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (getenv("SSH_AUTH_SOCK")) {
|
if (getenv("SSH_AUTH_SOCK")) {
|
||||||
ssh_socket_close(agent->sock);
|
ssh_socket_close(agent->sock);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user