Fix an handle leak

This commit is contained in:
carlo-bramini 2017-10-22 19:13:16 +02:00
parent 9be61b5cd4
commit e1c3b46ee2

View file

@ -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;
}
/**