Use calloc instead of zeroizing structure after malloc

Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
Jakub Jelen
2025-08-01 11:55:50 +02:00
parent 737f9ecc3c
commit d1bf9068a9
5 changed files with 9 additions and 13 deletions

View File

@@ -136,11 +136,10 @@ ssh_agent ssh_agent_new(struct ssh_session_struct *session)
{
ssh_agent agent = NULL;
agent = malloc(sizeof(struct ssh_agent_struct));
agent = calloc(1, sizeof(struct ssh_agent_struct));
if (agent == NULL) {
return NULL;
}
ZERO_STRUCTP(agent);
agent->count = 0;
agent->sock = ssh_socket_new(session);