projects
/
project
/
luci.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
libs/web: fix file handle leak in template parser
[project/luci.git]
/
libs
/
web
/
src
/
template_lualib.c
diff --git
a/libs/web/src/template_lualib.c
b/libs/web/src/template_lualib.c
index
685613f
..
f91b19c
100644
(file)
--- 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;
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;
}
{
return 1;
}