]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Minor] Fix build issues
authorVsevolod Stakhov <vsevolod@rspamd.com>
Fri, 20 Jun 2025 14:12:04 +0000 (15:12 +0100)
committerVsevolod Stakhov <vsevolod@rspamd.com>
Fri, 20 Jun 2025 14:12:04 +0000 (15:12 +0100)
src/libstat/stat_process.c
src/lua/lua_parsers.c

index 0bb658a3a72e657c8accb1a178397d4c58497ddd..176064087bd2e047e74f830b937da200dfb33d9b 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2024 Vsevolod Stakhov
+ * Copyright 2025 Vsevolod Stakhov
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -108,12 +108,12 @@ rspamd_stat_tokenize_parts_metadata(struct rspamd_stat_ctx *st_ctx,
                                                                                 "M",
                                                                                 task->tokens);
        }
-       goto meta_words_done;
 
+       return;
 meta_words_error:
-       /* On error, just continue without the problematic tokens */
-meta_words_done:
-       /* kvec memory will be freed with task pool */
+
+       msg_err("cannot process meta words for task"
+                       "memory allocation error, skipping the remaining");
 }
 
 /*
index f1208abd2a4c786365bc19997f8d52d13d512de3..4756b1180d520c88ea47556efec969dd0f95457a 100644 (file)
@@ -108,8 +108,8 @@ int lua_parsers_tokenize_text(lua_State *L)
        struct rspamd_lua_text *t;
        struct rspamd_process_exception *ex;
        UText utxt = UTEXT_INITIALIZER;
-       GArray *res;
-       rspamd_stat_token_t *w;
+       rspamd_words_t *res;
+       rspamd_word_t *w;
 
        if (lua_type(L, 1) == LUA_TSTRING) {
                in = luaL_checklstring(L, 1, &len);
@@ -175,10 +175,10 @@ int lua_parsers_tokenize_text(lua_State *L)
                lua_pushnil(L);
        }
        else {
-               lua_createtable(L, res->len, 0);
+               lua_createtable(L, kv_size(*res), 0);
 
-               for (i = 0; i < res->len; i++) {
-                       w = &g_array_index(res, rspamd_stat_token_t, i);
+               for (i = 0; i < kv_size(*res); i++) {
+                       w = &kv_A(*res, i);
                        lua_pushlstring(L, w->original.begin, w->original.len);
                        lua_rawseti(L, -2, i + 1);
                }