From 71bcb0ebbf3f0616ea18e0597c8b1d6f783b4ac3 Mon Sep 17 00:00:00 2001 From: John-Mark Gurney Date: Fri, 5 Mar 2021 23:22:45 +0000 Subject: [PATCH] change this to a better initalization since malloc isn't spelled calloc here.. --- ggatessh/ggatessh.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/ggatessh/ggatessh.c b/ggatessh/ggatessh.c index 94b289e..692c036 100644 --- a/ggatessh/ggatessh.c +++ b/ggatessh/ggatessh.c @@ -696,9 +696,11 @@ proc_thread(void *arg __unused) session = start_conn.c_session; gsc = malloc(sizeof *gsc); - gsc->sc_ssh_session = start_conn.c_session; - gsc->sc_session = start_conn.c_sftp_session; - gsc->sc_handle = start_conn.c_handle; + *gsc = (struct ggs_sess_cache){ + .sc_ssh_session = start_conn.c_session, + .sc_session = start_conn.c_sftp_session, + .sc_handle = start_conn.c_handle, + }; TAILQ_INSERT_HEAD(&session_cache, gsc, sc_next); gsc = NULL;