diff options
-rw-r--r-- | src/knownhosts.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/knownhosts.c b/src/knownhosts.c index 6cb14989..3e16b7f5 100644 --- a/src/knownhosts.c +++ b/src/knownhosts.c @@ -190,6 +190,7 @@ static int ssh_known_hosts_read_entries(const char *match, entry_list = ssh_list_new(); if (entry_list == NULL) { + fclose(fp); return SSH_ERROR; } @@ -225,9 +226,11 @@ static int ssh_known_hosts_read_entries(const char *match, *entries = entry_list; + fclose(fp); return SSH_OK; error: ssh_list_free(entry_list); + fclose(fp); return SSH_ERROR; } |