aboutsummaryrefslogtreecommitdiffstats
path: root/src/libutil/fstring.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2015-10-07 13:10:17 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2015-10-07 13:10:17 +0100
commit62b2188d8282e5dda9a388a851cd701434f69124 (patch)
tree0cd5ebdfc511dcd2f492bc8e95f1935e6ca4d308 /src/libutil/fstring.c
parent3b9d4282aea747995442cbebcc6b4908c6b52049 (diff)
downloadrspamd-62b2188d8282e5dda9a388a851cd701434f69124.tar.gz
rspamd-62b2188d8282e5dda9a388a851cd701434f69124.zip
Add routine to free fstring mapped ftoks.
Diffstat (limited to 'src/libutil/fstring.c')
-rw-r--r--src/libutil/fstring.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/libutil/fstring.c b/src/libutil/fstring.c
index 232b0021c..e63912c9a 100644
--- a/src/libutil/fstring.c
+++ b/src/libutil/fstring.c
@@ -319,3 +319,14 @@ rspamd_ftok_cmp (const rspamd_ftok_t *s1,
return s1->len - s2->len;
}
+
+void
+rspamd_fstring_mapped_ftok_free (gpointer p)
+{
+ rspamd_ftok_t *tok = p;
+ rspamd_fstring_t *storage;
+
+ storage = (rspamd_fstring_t *) (tok->begin - 2 * sizeof (gsize));
+ rspamd_fstring_free (storage);
+ g_slice_free1 (sizeof (*tok), tok);
+} \ No newline at end of file