aboutsummaryrefslogtreecommitdiff
path: root/src/agent.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/agent.c')
-rw-r--r--src/agent.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/agent.c b/src/agent.c
index 95cf6a12..897641b1 100644
--- a/src/agent.c
+++ b/src/agent.c
@@ -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();