]> source.dussan.org Git - rspamd.git/commitdiff
[Fix] Strings returned from lua are ephemeral
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 16 Feb 2017 13:17:16 +0000 (13:17 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 16 Feb 2017 13:17:16 +0000 (13:17 +0000)
Pointy hat to: @fatalbanana

src/lua/lua_task.c

index af85282f2a97a76ee2aaf0948bff59af5f3bf7ab..17f55b8b238095812b136106bc27ba015e0b9e51 100644 (file)
@@ -3425,7 +3425,7 @@ lua_task_set_metric_subject (lua_State *L)
        subject = luaL_checkstring (L, 2);
 
        if (task && metric && subject) {
-               metric->subject = subject;
+               metric->subject = rspamd_mempool_strdup (task->task_pool, subject);
                lua_pushboolean (L, true);
        }
        else {