]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Fix more error paths in Lua
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 21 Sep 2021 10:38:17 +0000 (11:38 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 21 Sep 2021 10:38:17 +0000 (11:38 +0100)
Found by: coverity scan

src/lua/lua_http.c

index 68c9bb9274edabc351729a520de648759c7e95dc..2f1a1c5a73db2505818f6991dec7a4aa4830fc43 100644 (file)
@@ -969,6 +969,9 @@ lua_http_request (lua_State *L)
                if (body) {
                        rspamd_fstring_free (body);
                }
+               if (local_kp) {
+                       rspamd_keypair_unref (local_kp);
+               }
 
                return 1;
        }
@@ -978,6 +981,9 @@ lua_http_request (lua_State *L)
                if (body) {
                        rspamd_fstring_free (body);
                }
+               if (local_kp) {
+                       rspamd_keypair_unref (local_kp);
+               }
 
                return luaL_error (L,
                                "Bad params to rspamd_http:request(): either task or config should be set");
@@ -989,6 +995,9 @@ lua_http_request (lua_State *L)
                if (body) {
                        rspamd_fstring_free (body);
                }
+               if (local_kp) {
+                       rspamd_keypair_unref (local_kp);
+               }
 
                return luaL_error (L,
                                "Bad params to rspamd_http:request(): ev_base isn't passed");