diff mbox series

[10/19] Removed a resource leak from nsm/file.c

Message ID 20190508133536.6077-11-steved@redhat.com (mailing list archive)
State New, archived
Headers show
Series Covertity Scan: Removed resources leaks | expand

Commit Message

Steve Dickson May 8, 2019, 1:35 p.m. UTC
nsm/file.c:536: leaked_handle: Handle variable "fd" going
	out of scope leaks the handle

Signed-off-by: Steve Dickson <steved@redhat.com>
---
 support/nsm/file.c | 1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

diff --git a/support/nsm/file.c b/support/nsm/file.c
index 52f5401..0b66f12 100644
--- a/support/nsm/file.c
+++ b/support/nsm/file.c
@@ -533,6 +533,7 @@  nsm_update_kernel_state(const int state)
 	len = snprintf(buf, sizeof(buf), "%d", state);
 	if (error_check(len, sizeof(buf))) {
 		xlog_warn("Failed to form NSM state number string");
+		close(fd);
 		return;
 	}