From: Vsevolod Stakhov Date: Mon, 12 Jun 2017 10:05:20 +0000 (+0100) Subject: [Minor] Adopt to glib insane GHashTable X-Git-Tag: 1.6.0~10 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=a8ec6f2ee7b2d5d87f802d1e42f2fd107a3cb79d;p=rspamd.git [Minor] Adopt to glib insane GHashTable --- 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 {