BUG/MINOR: lua: memory leak executing tasks

The struct hlua isn't freed when the task is complete.

This patch should be backported in 1.6 and 1.7
This commit is contained in:
Thierry FOURNIER 2016-12-17 11:46:06 +01:00 committed by Willy Tarreau
parent 33834b15dc
commit 4e7c708612

View File

@ -5300,6 +5300,7 @@ static struct task *hlua_process_task(struct task *task)
/* finished or yield */
case HLUA_E_OK:
hlua_ctx_destroy(hlua);
free(hlua);
task_delete(task);
task_free(task);
break;
@ -5313,6 +5314,7 @@ static struct task *hlua_process_task(struct task *task)
case HLUA_E_ERRMSG:
SEND_ERR(NULL, "Lua task: %s.\n", lua_tostring(hlua->T, -1));
hlua_ctx_destroy(hlua);
free(hlua);
task_delete(task);
task_free(task);
break;
@ -5321,6 +5323,7 @@ static struct task *hlua_process_task(struct task *task)
default:
SEND_ERR(NULL, "Lua task: unknown error.\n");
hlua_ctx_destroy(hlua);
free(hlua);
task_delete(task);
task_free(task);
break;