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:
@@ -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 */
|
/* send message to the agent requesting the list of identities */
|
||||||
request = ssh_buffer_new();
|
request = ssh_buffer_new();
|
||||||
|
if (request == NULL) {
|
||||||
|
ssh_set_error_oom(request);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
if (buffer_add_u8(request, c1) < 0) {
|
if (buffer_add_u8(request, c1) < 0) {
|
||||||
ssh_set_error(session, SSH_FATAL, "Not enough space");
|
ssh_set_error_oom(request);
|
||||||
return -1;
|
ssh_buffer_free(request);
|
||||||
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
reply = ssh_buffer_new();
|
reply = ssh_buffer_new();
|
||||||
|
|||||||
Reference in New Issue
Block a user