]> source.dussan.org Git - rspamd.git/commitdiff
Add helper to use GString in pool destructors.
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 18 May 2015 15:54:29 +0000 (16:54 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 18 May 2015 15:54:29 +0000 (16:54 +0100)
src/libutil/util.c
src/libutil/util.h

index 6efe1b477a4be88cace084a23b7093e7f85de067..15f73bf0942dc1ce27427a98e308fb4aeaf85944 100644 (file)
@@ -2386,6 +2386,14 @@ rspamd_array_free_hard (gpointer p)
        g_array_free (ar, TRUE);
 }
 
+void
+rspamd_gstring_free_hard (gpointer p)
+{
+       GString *ar = (GString *)p;
+
+       g_string_free (ar, TRUE);
+}
+
 
 void
 rspamd_init_libs (void)
index f3a8dcbc5fce581bbca2e10472df7544d58294be..af2e00065b10983d6a4995a22f8ac6ed0c9129f0 100644 (file)
@@ -451,6 +451,11 @@ void rspamd_ptr_array_free_hard (gpointer p);
  * @param p
  */
 void rspamd_array_free_hard (gpointer p);
+/**
+ * Special utility to help GString freeing in rspamd_mempool
+ * @param p
+ */
+void rspamd_gstring_free_hard (gpointer p);
 
 /**
  * Initialize rspamd libraries