]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: lua: bad return code
authorThierry FOURNIER <thierry.fournier@ozon.io>
Sat, 17 Dec 2016 11:05:56 +0000 (12:05 +0100)
committerWilly Tarreau <w@1wt.eu>
Wed, 21 Dec 2016 14:24:24 +0000 (15:24 +0100)
If the lua/cli fails during initialization, it returns an ok
status, an the execution continue. This will probably occur a
segfault.

Thiw patch should be backported in 1.7

src/hlua.c

index 28ddf44bb3dca8f5e9a45cf86f9b6be2319183de..326f723b447abd54c0b857aeeed5fb90de257c1c 100644 (file)
@@ -6677,7 +6677,7 @@ static int hlua_cli_parse_fct(char **args, struct appctx *appctx, void *private)
        appctx->ctx.hlua_cli.task = task_new();
        if (!appctx->ctx.hlua_cli.task) {
                SEND_ERR(NULL, "Lua cli '%s': out of memory.\n", fcn->name);
-               return 0;
+               return 1;
        }
        appctx->ctx.hlua_cli.task->nice = 0;
        appctx->ctx.hlua_cli.task->context = appctx;