]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: lua: memory leak executing tasks
authorThierry FOURNIER <thierry.fournier@ozon.io>
Sat, 17 Dec 2016 10:46:06 +0000 (11:46 +0100)
committerWilly Tarreau <w@1wt.eu>
Wed, 21 Dec 2016 14:24:09 +0000 (15:24 +0100)
The struct hlua isn't freed when the task is complete.

This patch should be backported in 1.6 and 1.7

src/hlua.c

index 17a67503dd6b4e0bee50738b4ed6663e13807511..28ddf44bb3dca8f5e9a45cf86f9b6be2319183de 100644 (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;