[PATCH 7/7] module ranges: fix file pointer leak

Kris Van Hees <[email protected]>
Newsgroups dev.linux.lists.dtrace
Message-ID <BY5PR10MB39872E36B0D41AD794563D95C2D6A@BY5PR10MB3987.namprd10.prod.outlook.com>
The file pointer to modules.builtin.ranges was never closed.

Signed-off-by: Kris Van Hees <[email protected]>
---
 libdtrace/dt_module.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/libdtrace/dt_module.c b/libdtrace/dt_module.c
index 7ec1b550..00978911 100644
--- a/libdtrace/dt_module.c
+++ b/libdtrace/dt_module.c
@@ -1618,8 +1618,12 @@ dtrace_update(dtrace_hdl_t *dtp)
 		dt_module_shuffle_to_start(dtp, "vmlinux");
 	}
 
-	if (state)
+	if (state) {
+		if (state->rfp)
+			fclose(state->rfp);
+
 		dt_free(dtp, state);
+	}
 
 	return 0;
 }
-- 
2.43.5
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.