From: Vsevolod Stakhov Date: Tue, 19 Sep 2017 18:32:34 +0000 (+0100) Subject: [Minor] Avoid using alloca X-Git-Tag: 1.7.0~625 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=8e28ab597f8cd87358c9b5a674cfbdd789385dfb;p=rspamd.git [Minor] Avoid using alloca --- diff --git a/src/lua/lua_util.c b/src/lua/lua_util.c index a9f01429e..eedfcb625 100644 --- a/src/lua/lua_util.c +++ b/src/lua/lua_util.c @@ -1712,11 +1712,11 @@ lua_util_random_hex (lua_State *L) static gint lua_util_zstd_compress (lua_State *L) { - struct rspamd_lua_text *t = NULL, *res; + struct rspamd_lua_text *t = NULL, *res, tmp; gsize sz, r; if (lua_type (L, 1) == LUA_TSTRING) { - t = g_alloca (sizeof (*t)); + t = &tmp; t->start = lua_tolstring (L, 1, &sz); t->len = sz; }