g_string_free (ar, TRUE);
}
-void
-rspamd_gstring_free_soft (gpointer p)
+void rspamd_gerror_free_maybe (gpointer p)
{
- GString *ar = (GString *)p;
+ GError **err;
+
+ if (p) {
+ err = (GError **)p;
- g_string_free (ar, FALSE);
+ if (*err) {
+ g_error_free (*err);
+ }
+ }
}
struct rspamd_external_libs_ctx *
*/
void rspamd_gstring_free_hard (gpointer p);
+/**
+ * Special utility to help GError freeing in rspamd_mempool
+ * @param p
+ */
+void rspamd_gerror_free_maybe (gpointer p);
+
/**
* Special utility to help GString freeing (without freeing the memory segment) in rspamd_mempool
* @param p