1
0
mirror of https://git.libssh.org/projects/libssh.git synced 2025-12-21 19:31:17 +03:00

agent: Fix possible memory leak.

This commit is contained in:
Andreas Schneider
2013-06-19 12:19:05 +02:00
parent de4cb811a0
commit f0a362fdbe

View File

@@ -287,9 +287,14 @@ int ssh_agent_get_ident_count(struct ssh_session_struct *session) {
/* send message to the agent requesting the list of identities */
request = ssh_buffer_new();
if (request == NULL) {
ssh_set_error_oom(request);
return -1;
}
if (buffer_add_u8(request, c1) < 0) {
ssh_set_error(session, SSH_FATAL, "Not enough space");
return -1;
ssh_set_error_oom(request);
ssh_buffer_free(request);
return -1;
}
reply = ssh_buffer_new();