diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-02-09 16:43:40 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-02-09 16:43:40 +0000 |
commit | c2cbcd8d98ae8e1b8d1ef06bc6dc53f77ac3bd16 (patch) | |
tree | e8742046ad3eac446a64576f9bfd605e583e9ee5 /src/lua/lua_trie.c | |
parent | dcbe3146b882a731e1cd82025607bd423bb82024 (diff) | |
download | rspamd-c2cbcd8d98ae8e1b8d1ef06bc6dc53f77ac3bd16.tar.gz rspamd-c2cbcd8d98ae8e1b8d1ef06bc6dc53f77ac3bd16.zip |
Fix some issues found by coverity
Diffstat (limited to 'src/lua/lua_trie.c')
-rw-r--r-- | src/lua/lua_trie.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/lua/lua_trie.c b/src/lua/lua_trie.c index 987818608..8f68d76d1 100644 --- a/src/lua/lua_trie.c +++ b/src/lua/lua_trie.c @@ -176,6 +176,7 @@ lua_trie_search_str (lua_State *L, ac_trie_t *trie, const gchar *str, gsize len, { struct lua_trie_cbdata cb; gboolean icase = FALSE; + gint ret; if (lua_gettop (L) == 4) { icase = lua_toboolean (L, 4); @@ -183,10 +184,13 @@ lua_trie_search_str (lua_State *L, ac_trie_t *trie, const gchar *str, gsize len, cb.L = L; cb.found = FALSE; - acism_lookup (trie, str, len, - lua_trie_callback, &cb, statep, icase); - return cb.found; + if ((ret = acism_lookup (trie, str, len, + lua_trie_callback, &cb, statep, icase)) == 0) { + return cb.found; + } + + return ret; } /*** |