]> source.dussan.org Git - rspamd.git/commitdiff
Fix incorrect allocation size
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 15 Oct 2015 23:21:07 +0000 (00:21 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 15 Oct 2015 23:21:07 +0000 (00:21 +0100)
src/libutil/http.c

index 871718b7458cfca76c43e205566edc3f6d8d1133..72134e22d290192d18017c979696187b5b8daf0c 100644 (file)
@@ -1742,7 +1742,7 @@ rspamd_http_message_free (struct rspamd_http_message *msg)
        {
                rspamd_fstring_free (hdr->combined);
                g_slice_free1 (sizeof (*hdr->name), hdr->name);
-               g_slice_free1 (sizeof (*hdr->name), hdr->value);
+               g_slice_free1 (sizeof (*hdr->value), hdr->value);
                g_slice_free1 (sizeof (struct rspamd_http_header), hdr);
        }
        if (msg->body != NULL) {
@@ -1778,8 +1778,8 @@ rspamd_http_message_add_header (struct rspamd_http_message *msg,
                vlen = strlen (value);
                hdr->combined = rspamd_fstring_sized_new (nlen + vlen + 4);
                rspamd_printf_fstring (&hdr->combined, "%s: %s\r\n", name, value);
-               hdr->value = g_slice_alloc (sizeof (GString));
-               hdr->name = g_slice_alloc (sizeof (GString));
+               hdr->value = g_slice_alloc (sizeof (*hdr->value));
+               hdr->name = g_slice_alloc (sizeof (*hdr->name));
                hdr->name->begin = hdr->combined->str;
                hdr->name->len = nlen;
                hdr->value->begin = hdr->combined->str + nlen + 2;