From fb2c15a39a8fc4321a3658c6fec96f6f8bee64a8 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Fri, 16 Oct 2015 00:21:07 +0100 Subject: [PATCH] Fix incorrect allocation size --- src/libutil/http.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/libutil/http.c b/src/libutil/http.c index 871718b74..72134e22d 100644 --- a/src/libutil/http.c +++ b/src/libutil/http.c @@ -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; -- 2.39.5