commit 609e3d1: [Minor] Fix misplaced code

Vsevolod Stakhov vsevolod at highsecure.ru
Thu Jan 24 15:07:03 UTC 2019


Author: Vsevolod Stakhov
Date: 2019-01-24 15:02:30 +0000
URL: https://github.com/rspamd/rspamd/commit/609e3d1f83548b47a8a3cc4a8cd1e6c2fbd996fe (HEAD -> master)

[Minor] Fix misplaced code

---
 src/lua/lua_task.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/src/lua/lua_task.c b/src/lua/lua_task.c
index f8c624e60..7b21ccc0d 100644
--- a/src/lua/lua_task.c
+++ b/src/lua/lua_task.c
@@ -1389,15 +1389,15 @@ lua_task_load_from_file (lua_State * L)
 				else {
 					g_string_append_len (data, buf, r);
 				}
-
-				task = rspamd_task_new (NULL, cfg, NULL, NULL, NULL);
-				task->msg.begin = data->str;
-				task->msg.len = data->len;
-				rspamd_mempool_add_destructor (task->task_pool,
-						lua_task_free_dtor, task);
-				res = TRUE;
-				g_string_free (data, FALSE); /* Buffer is still valid */
 			}
+
+			task = rspamd_task_new (NULL, cfg, NULL, NULL, NULL);
+			task->msg.begin = data->str;
+			task->msg.len = data->len;
+			rspamd_mempool_add_destructor (task->task_pool,
+					lua_task_free_dtor, task);
+			res = TRUE;
+			g_string_free (data, FALSE); /* Buffer is still valid */
 		}
 		else {
 			map = rspamd_file_xmap (fname, PROT_READ, &sz, TRUE);


More information about the Commits mailing list