commit 7c24396: [Minor] Fix pushing lua_url structure

Vsevolod Stakhov vsevolod at highsecure.ru
Fri Jul 2 13:07:38 UTC 2021


Author: Vsevolod Stakhov
Date: 2021-07-02 14:02:16 +0100
URL: https://github.com/rspamd/rspamd/commit/7c24396600cb624dc874e26c383d54352af4d195

[Minor] Fix pushing lua_url structure

---
 src/lua/lua_html.cxx | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/lua/lua_html.cxx b/src/lua/lua_html.cxx
index 4348d91c0..370f2230e 100644
--- a/src/lua/lua_html.cxx
+++ b/src/lua/lua_html.cxx
@@ -620,7 +620,6 @@ lua_html_tag_get_extra (lua_State *L)
 	LUA_TRACE_POINT;
 	struct lua_html_tag *ltag = lua_check_html_tag (L, 1);
 	struct html_image *img;
-	struct rspamd_url **purl;
 
 	if (ltag) {
 		if (!std::holds_alternative<std::monostate>(ltag->tag->extra)) {
@@ -630,8 +629,8 @@ lua_html_tag_get_extra (lua_State *L)
 			}
 			else if (std::holds_alternative<struct rspamd_url *>(ltag->tag->extra)) {
 				/* For A that's URL */
-				purl = static_cast<rspamd_url **>(lua_newuserdata(L, sizeof(gpointer)));
-				*purl = std::get<struct rspamd_url *>(ltag->tag->extra);
+				auto *lua_url =  static_cast<rspamd_lua_url *>(lua_newuserdata(L, sizeof(rspamd_lua_url)));
+				lua_url->url = std::get<struct rspamd_url *>(ltag->tag->extra);
 				rspamd_lua_setclass (L, "rspamd{url}", -1);
 			}
 			else {


More information about the Commits mailing list