From: Willy Tarreau Date: Fri, 25 Sep 2015 23:33:24 +0000 (+0200) Subject: CLEANUP: lua: remove unneeded memset(0) after calloc() X-Git-Tag: v1.6-dev6~54 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7a4501757f38de0c9cfbe75d8a7034fa3f819367;p=thirdparty%2Fhaproxy.git CLEANUP: lua: remove unneeded memset(0) after calloc() No need for these memset() anymore, since calloc() was put there to avoid them. --- diff --git a/src/hlua.c b/src/hlua.c index 3f7acf6d1b..2d3f1e2e59 100644 --- a/src/hlua.c +++ b/src/hlua.c @@ -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);