]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Avoid using alloca
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 19 Sep 2017 18:32:34 +0000 (19:32 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 19 Sep 2017 18:33:41 +0000 (19:33 +0100)
src/lua/lua_util.c

index a9f01429ea0982021ac2c85ce3ca451dafcd7286..eedfcb625696c5b87e059a1e64ca6e6d7c38783c 100644 (file)
@@ -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;
        }