aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakub Jelen <jjelen@redhat.com>2018-11-02 12:58:25 +0100
committerAndreas Schneider <asn@cryptomilk.org>2018-11-02 13:26:09 +0100
commit1650d8178e482b2824a3e0eff9b6bba837f45749 (patch)
treeaba2c3abfa14dc14edd0231bf00d9605ca0437df
parent6eb43fcbf3757f24325e7a0432f0ba02cfe4757f (diff)
downloadlibssh-1650d8178e482b2824a3e0eff9b6bba837f45749.tar.gz
libssh-1650d8178e482b2824a3e0eff9b6bba837f45749.tar.xz
libssh-1650d8178e482b2824a3e0eff9b6bba837f45749.zip
config: Avoid potential file descriptor leak
Found by csbuild runner. Signed-off-by: Jakub Jelen <jjelen@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
-rw-r--r--src/config.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/config.c b/src/config.c
index aaf2970f..dbfead98 100644
--- a/src/config.c
+++ b/src/config.c
@@ -844,6 +844,7 @@ int ssh_config_parse_file(ssh_session session, const char *filename)
if (session->opts.options_seen == NULL) {
seen = calloc(SOC_END - SOC_UNSUPPORTED, sizeof(uint8_t));
if (seen == NULL) {
+ fclose(f);
ssh_set_error_oom(session);
return -1;
}