]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: lua: remove unneeded memset(0) after calloc()
authorWilly Tarreau <w@1wt.eu>
Fri, 25 Sep 2015 23:33:24 +0000 (01:33 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 25 Sep 2015 23:33:24 +0000 (01:33 +0200)
No need for these memset() anymore, since calloc() was put there
to avoid them.

src/hlua.c

index 3f7acf6d1ba3cd1a615e955934b238d183394915..2d3f1e2e59aa19aa68fad06207c3395bf6876b1f 100644 (file)
@@ -4364,9 +4364,6 @@ __LJMP static int hlua_register_converters(lua_State *L)
        sck->kw[0].out_type = SMP_T_STR;
        sck->kw[0].private = fcn;
 
-       /* End of array. */
-       memset(&sck->kw[1], 0, sizeof(struct sample_conv));
-
        /* Register this new converter */
        sample_register_convs(sck);
 
@@ -4425,9 +4422,6 @@ __LJMP static int hlua_register_fetches(lua_State *L)
        sfk->kw[0].val = 0;
        sfk->kw[0].private = fcn;
 
-       /* End of array. */
-       memset(&sfk->kw[1], 0, sizeof(struct sample_fetch));
-
        /* Register this new fetch. */
        sample_register_fetches(sfk);
 
@@ -4647,9 +4641,6 @@ __LJMP static int hlua_register_action(lua_State *L)
                /* List head */
                akl->list.n = akl->list.p = NULL;
 
-               /* End of array. */
-               memset(&akl->kw[1], 0, sizeof(*akl->kw));
-
                /* action keyword. */
                len = strlen("lua.") + strlen(name) + 1;
                akl->kw[0].kw = calloc(1, len);