From a8ec6f2ee7b2d5d87f802d1e42f2fd107a3cb79d Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Mon, 12 Jun 2017 11:05:20 +0100 Subject: [PATCH] [Minor] Adopt to glib insane GHashTable --- src/libserver/milter.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/libserver/milter.c b/src/libserver/milter.c index de20d1d4d..18a9a8e24 100644 --- a/src/libserver/milter.c +++ b/src/libserver/milter.c @@ -518,10 +518,11 @@ rspamd_milter_process_command (struct rspamd_milter_session *session, num = GPOINTER_TO_INT (res); num ++; /* - * No need to copy, as insert does not call - * destroy function for a key + * We need to copy as glib is totally insane about it: + * > If you supplied a key_destroy_func when creating the + * > GHashTable, the passed key is freed using that function. */ - g_hash_table_insert (priv->headers, (gpointer)pos, + g_hash_table_insert (priv->headers, g_strdup (pos), GINT_TO_POINTER (num)); } else { -- 2.39.5