From: Vsevolod Stakhov Date: Thu, 15 Oct 2015 23:21:07 +0000 (+0100) Subject: Fix incorrect allocation size X-Git-Tag: 1.0.6~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fb2c15a39a8fc4321a3658c6fec96f6f8bee64a8;p=thirdparty%2Frspamd.git Fix incorrect allocation size --- diff --git a/src/libutil/http.c b/src/libutil/http.c index 871718b745..72134e22d2 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;