Commit 8b8fb77
BUG/MINOR: hlua: fix leak in hlua_ckch_set() error path
in hlua_ckch_commit_yield() and hlua_ckch_set(), when an error occurs,
we enter the error path and try to raise an error from the <err> msg
pointer which must be freed afterwards.
However, the fact that luaL_error() never returns was overlooked, because
of that <err> msg is never freed in such case.
To fix the issue, let's use hlua_pushfstring_safe() helper to push the
err on the lua stack and then free it before throwing the error using
lua_error().
It should be backported up to 2.6 with 30fcca1 ("MINOR: ssl/lua:
CertCache.set() allows to update an SSL certificate file")
(cherry picked from commit 755c2da)
Signed-off-by: Amaury Denoyelle <[email protected]>1 parent 342d239 commit 8b8fb77
1 file changed
+5
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13143 | 13143 | | |
13144 | 13144 | | |
13145 | 13145 | | |
13146 | | - | |
| 13146 | + | |
13147 | 13147 | | |
| 13148 | + | |
13148 | 13149 | | |
13149 | 13150 | | |
13150 | 13151 | | |
| |||
13287 | 13288 | | |
13288 | 13289 | | |
13289 | 13290 | | |
13290 | | - | |
| 13291 | + | |
| 13292 | + | |
| 13293 | + | |
13291 | 13294 | | |
13292 | 13295 | | |
13293 | 13296 | | |
| |||
0 commit comments