From 077cee773330eda0b994b7b70fa1d6ec307db478 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Tue, 21 Sep 2021 11:38:17 +0100 Subject: [Minor] Fix more error paths in Lua Found by: coverity scan --- src/lua/lua_http.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/lua/lua_http.c') diff --git a/src/lua/lua_http.c b/src/lua/lua_http.c index 68c9bb927..2f1a1c5a7 100644 --- a/src/lua/lua_http.c +++ b/src/lua/lua_http.c @@ -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"); -- cgit v1.2.3