summaryrefslogtreecommitdiffstats
path: root/src/lua/lua_text.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2021-09-18 12:29:57 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2021-09-18 12:29:57 +0100
commit4041c2d64024f27488461e03fcd587dfbb34c4b0 (patch)
tree9af52fdbc4789fc8f35f164a414431ca37710b43 /src/lua/lua_text.c
parent1589bd19ff7c841203c548de2c5897e0f0f22c6d (diff)
downloadrspamd-4041c2d64024f27488461e03fcd587dfbb34c4b0.tar.gz
rspamd-4041c2d64024f27488461e03fcd587dfbb34c4b0.zip
[Minor] Plug some leaks on error paths
Found by: coverity scan
Diffstat (limited to 'src/lua/lua_text.c')
-rw-r--r--src/lua/lua_text.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/lua/lua_text.c b/src/lua/lua_text.c
index dde7e2c23..bec16c3b6 100644
--- a/src/lua/lua_text.c
+++ b/src/lua/lua_text.c
@@ -920,6 +920,10 @@ lua_text_split (lua_State *L)
struct rspamd_lua_regexp *re;
gboolean stringify = FALSE, own_re = FALSE;
+ if (t == NULL) {
+ return luaL_error (L, "invalid arguments");
+ }
+
if (lua_type (L, 2) == LUA_TUSERDATA) {
re = lua_check_regexp (L, 2);
}
@@ -947,7 +951,7 @@ lua_text_split (lua_State *L)
own_re = TRUE;
}
- if (t && re) {
+ if (re) {
if (lua_isboolean (L, 3)) {
stringify = lua_toboolean (L, 3);
}