From 1a17ffcc07ff7021d66940f58f42bfaa78e763bf Mon Sep 17 00:00:00 2001 From: Chris Leech Date: Wed, 30 Oct 2019 14:08:57 -0700 Subject: [PATCH 33/43] Resource leak: Handle variable fd going out of scope leaks the handle. --- usr/iscsi_util.c | 1 + 1 file changed, 1 insertion(+) diff --git a/usr/iscsi_util.c b/usr/iscsi_util.c index 0570dd5..fd8fc0c 100644 --- a/usr/iscsi_util.c +++ b/usr/iscsi_util.c @@ -62,6 +62,7 @@ void daemon_init(void) setsid(); if (chdir("/") < 0) log_debug(1, "Could not chdir to /: %s", strerror(errno)); + close(fd); } #define ISCSI_OOM_PATH_LEN 48 -- 2.21.0