]> source.dussan.org Git - rspamd.git/commitdiff
[Fix] Another refcount fix
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 7 Jul 2016 14:02:56 +0000 (15:02 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 7 Jul 2016 14:02:56 +0000 (15:02 +0100)
src/plugins/dkim_check.c

index b405afed00ceb631bbbe77fedf6f03d3684abe5a..c3503e7aa6a95320a22bb7cbbd16326b4895da46 100644 (file)
@@ -782,10 +782,10 @@ dkim_sign_callback (struct rspamd_task *task, void *unused)
 
                                hdr = rspamd_dkim_sign (task, selector, domain, 0, 0, ctx);
 
-                               rspamd_mempool_set_variable (task->task_pool, "dkim-signature",
-                                               hdr, rspamd_gstring_free_hard);
-
-                               rspamd_dkim_sign_key_unref (dkim_key);
+                               if (hdr) {
+                                       rspamd_mempool_set_variable (task->task_pool, "dkim-signature",
+                                                       hdr, rspamd_gstring_free_hard);
+                               }
                        }
                        else {
                                sign = FALSE;