From e1c3b46ee2612e898983c7d275003b6238c3d914 Mon Sep 17 00:00:00 2001 From: carlo-bramini Date: Sun, 22 Oct 2017 19:13:16 +0200 Subject: [PATCH] Fix an handle leak --- src/bindings/fluid_cmd.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/bindings/fluid_cmd.c b/src/bindings/fluid_cmd.c index 5f8241db..ccec3bfe 100644 --- a/src/bindings/fluid_cmd.c +++ b/src/bindings/fluid_cmd.c @@ -387,6 +387,7 @@ fluid_source(fluid_cmd_handler_t* handler, const char *filename) { int file; fluid_shell_t shell; + int result; #ifdef WIN32 file = _open(filename, _O_RDONLY); @@ -397,7 +398,11 @@ fluid_source(fluid_cmd_handler_t* handler, const char *filename) return file; } fluid_shell_init(&shell, NULL, handler, file, fluid_get_stdout()); - return fluid_shell_run(&shell); + result = fluid_shell_run(&shell); + + close(file); + + return result; } /**