]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Fix lua stack for history
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 15 Mar 2017 15:54:33 +0000 (15:54 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 15 Mar 2017 15:54:33 +0000 (15:54 +0000)
src/controller.c

index dff75c9e1dd0b3bfe0f1c238c9c2eb3820ff629f..e878806a5d6f61eec7e2fe7565617aea4782ad06 100644 (file)
@@ -1501,27 +1501,23 @@ rspamd_controller_handle_lua_history (lua_State *L,
                        }
                        else {
                                msg_err_session ("rspamd_plugins.history.handler is not a function");
-                               lua_pop (L, 3);
+                               lua_settop (L, 0);
                                goto err;
                        }
-
-                       lua_pop (L, 1); /* Function */
                }
                else {
                        msg_err_session ("rspamd_plugins.history is not a table");
-                       lua_pop (L, 2);
+                       lua_settop (L, 0);
                        goto err;
                }
-
-               lua_pop (L, 1); /* plugins.history */
        }
        else {
                msg_err_session ("rspamd_plugins is absent or has incorrect type");
-               lua_pop (L, 1);
+               lua_settop (L, 0);
                goto err;
        }
 
-       lua_pop (L, 1); /* plugins global */
+       lua_settop (L, 0);
 
        return;
 err: