projects
/
oweals
/
luci.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1b557b0
)
libs/web: fix file handle leak in template parser
author
Jo-Philipp Wich
<jow@openwrt.org>
Sun, 26 Jul 2009 23:11:36 +0000
(23:11 +0000)
committer
Jo-Philipp Wich
<jow@openwrt.org>
Sun, 26 Jul 2009 23:11:36 +0000
(23:11 +0000)
libs/web/src/template_lualib.c
patch
|
blob
|
history
diff --git
a/libs/web/src/template_lualib.c
b/libs/web/src/template_lualib.c
index 685613fbdcccad36dd9afd1c0964ac74d566464a..f91b19ceb85c07f1778771cc29d72b1adfa94feb 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;
-
- 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;
}