From f5508c5161361dbc09eb0ff0a16691e708516546 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Mon, 19 Dec 2016 18:08:33 +0000 Subject: [PATCH] [Minor] Small fixes in lua api --- src/lua/lua_mempool.c | 3 ++- src/lua/lua_util.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/lua/lua_mempool.c b/src/lua/lua_mempool.c index 38482748f..8fe8b5cc3 100644 --- a/src/lua/lua_mempool.c +++ b/src/lua/lua_mempool.c @@ -141,7 +141,8 @@ rspamd_lua_check_mempool (lua_State * L, gint pos) static int lua_mempool_create (lua_State *L) { - struct memory_pool_s *mempool = rspamd_mempool_new (rspamd_mempool_suggest_size (), NULL), **pmempool; + struct memory_pool_s *mempool = rspamd_mempool_new ( + rspamd_mempool_suggest_size (), "lua"), **pmempool; if (mempool) { pmempool = lua_newuserdata (L, sizeof (struct memory_pool_s *)); diff --git a/src/lua/lua_util.c b/src/lua/lua_util.c index 03afb2913..3a12731c5 100644 --- a/src/lua/lua_util.c +++ b/src/lua/lua_util.c @@ -688,10 +688,11 @@ lua_util_decode_base64 (lua_State *L) if (t != NULL) { s = t->start; inlen = t->len; - zero_copy = TRUE; + if (t->flags & RSPAMD_TEXT_FLAG_OWN) { t->flags = 0; grab_own = TRUE; + zero_copy = TRUE; } } } -- 2.39.5