From 047d4e45f6d26d54d2019ff3d12e372fae3f2e22 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Sun, 26 Jul 2009 23:11:36 +0000 Subject: [PATCH] libs/web: fix file handle leak in template parser --- libs/web/src/template_lualib.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/libs/web/src/template_lualib.c b/libs/web/src/template_lualib.c index 685613fbd..f91b19ceb 100644 --- a/libs/web/src/template_lualib.c +++ b/libs/web/src/template_lualib.c @@ -29,8 +29,13 @@ int template_L_parse(lua_State *L) parser.flags = 0; parser.bufsize = 0; parser.state = T_STATE_TEXT_NEXT; - - if( !(lua_status = lua_load(L, template_reader, &parser, file)) ) + + lua_status = lua_load(L, template_reader, &parser, file); + + (void) close(parser.fd); + + + if( lua_status == 0 ) { return 1; } -- 2.11.0