Subject: memory leak in dfa.c

From: Aharon Robbins <[email-masked]>
Date: Thu, 24 Apr 2014 22:19:53 +0300

Hi.

Thanks to valgrind, I tracked down this memory leak in dfa.c. dfasuperset()
when it does dfafree(sup) doesn't free(sup).  Here's the fix.

Thanks,

Arnold
-----------------------
diff --git a/src/dfa.c b/src/dfa.c
index 8fc3d6f..9106814 100644
--- a/src/dfa.c
+++ b/src/dfa.c
@@ -3533,7 +3533,10 @@ dfasuperset (struct dfa *d)
   sup->tindex = j;
 
   if ((d->mb_cur_max == 1 && !have_achar) || !have_nchar)
-    dfafree (sup);
+    {
+      dfafree (sup);
+      free (sup);
+    }
   else
     d->superset = sup;
 }