]> source.dussan.org Git - rspamd.git/commitdiff
Fix memory issues.
authorVsevolod Stakhov <vsevolod@rambler-co.ru>
Fri, 10 Jun 2011 14:47:08 +0000 (18:47 +0400)
committerVsevolod Stakhov <vsevolod@rambler-co.ru>
Fri, 10 Jun 2011 14:47:08 +0000 (18:47 +0400)
src/plugins/spf.c

index 223bc1241356c87d12334a8c158c5e632828e14b..a7c48e702d5165b252e9e85347356e46b74d624f 100644 (file)
@@ -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);
        }