From: Thierry FOURNIER Date: Sat, 17 Dec 2016 10:46:06 +0000 (+0100) Subject: BUG/MINOR: lua: memory leak executing tasks X-Git-Tag: v1.8-dev1~251 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4e7c708612730d79f4cc2ec7617fce01665ff807;p=thirdparty%2Fhaproxy.git 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 --- diff --git a/src/hlua.c b/src/hlua.c index 17a67503dd..28ddf44bb3 100644 --- a/src/hlua.c +++ b/src/hlua.c @@ -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;