aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2015-10-16 00:21:07 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2015-10-16 00:21:07 +0100
commitfb2c15a39a8fc4321a3658c6fec96f6f8bee64a8 (patch)
treee085c7210c899263456a75e22bb8f6d0dcb4da42
parent8883080e552074e30e3a6689a87a246b91f239cb (diff)
downloadrspamd-fb2c15a39a8fc4321a3658c6fec96f6f8bee64a8.tar.gz
rspamd-fb2c15a39a8fc4321a3658c6fec96f6f8bee64a8.zip
Fix incorrect allocation size
-rw-r--r--src/libutil/http.c6
1 files 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;