]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Fix misplaced code
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 24 Jan 2019 15:02:30 +0000 (15:02 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 24 Jan 2019 15:02:30 +0000 (15:02 +0000)
src/lua/lua_task.c

index f8c624e600bc45ec3e7e8b18a85cd7a3fdd5ddb4..7b21ccc0dca060157138ebdd051d0c2e1c07f5c6 100644 (file)
@@ -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);