From b3a7e86a4ab2b7e77bbe8336cb1aa60c97fd1545 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Wed, 4 Jul 2018 07:09:24 +0200 Subject: [PATCH] knownhosts: Fix memory leak CID 1393774 Signed-off-by: Andreas Schneider --- src/knownhosts.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/knownhosts.c b/src/knownhosts.c index 1aa85603..006289f0 100644 --- a/src/knownhosts.c +++ b/src/knownhosts.c @@ -310,12 +310,14 @@ struct ssh_list *ssh_known_hosts_get_algorithms(ssh_session session) list = ssh_list_new(); if (list == NULL) { + SAFE_FREE(host_port); return NULL; } rc = ssh_known_hosts_read_entries(host_port, session->opts.knownhosts, &entry_list); + SAFE_FREE(host_port); if (rc != 0) { ssh_list_free(list); return NULL;