diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2017-06-12 11:05:20 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2017-06-12 11:05:20 +0100 |
commit | a8ec6f2ee7b2d5d87f802d1e42f2fd107a3cb79d (patch) | |
tree | 2ceed030309b6d2b27a1df496ee2f72f414cef1e | |
parent | 683bdf2c840e108d6a0b36971e02efb812691da9 (diff) | |
download | rspamd-a8ec6f2ee7b2d5d87f802d1e42f2fd107a3cb79d.tar.gz rspamd-a8ec6f2ee7b2d5d87f802d1e42f2fd107a3cb79d.zip |
[Minor] Adopt to glib insane GHashTable
-rw-r--r-- | src/libserver/milter.c | 7 |
1 files 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 { |