From: Vsevolod Stakhov Date: Fri, 10 Jun 2011 14:47:08 +0000 (+0400) Subject: Fix memory issues. X-Git-Tag: 0.3.14~2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=57c077a06e7d04d5d053a4f3565319dd9e41f442;p=rspamd.git Fix memory issues. --- diff --git a/src/plugins/spf.c b/src/plugins/spf.c index 223bc1241..a7c48e702 100644 --- a/src/plugins/spf.c +++ b/src/plugins/spf.c @@ -281,6 +281,11 @@ spf_record_copy (GList *addrs) /* Recursive call */ newa->data.list = spf_record_copy (addr->data.list); } + else { + if (addr->spf_string) { + newa->spf_string = g_strdup (addr->spf_string); + } + } newl = g_list_prepend (newl, newa); cur = g_list_next (cur); } @@ -305,8 +310,11 @@ spf_record_destroy (gpointer list) spf_record_destroy (addr->data.list); } else { - g_free (addr); + if (addr->spf_string) { + g_free (addr->spf_string); + } } + g_free (addr); cur = g_list_next (cur); }