Hello Paul and all,

> Paul Eggert wrote:
> We've now cut glibc 2.28 so I short-circuited all this by installing the fix
> into glibc (for 2.29) and propagating the fix into Gnulib. Thanks again.

Thanks for installing it.

I found another leak, this time in dfa:
pointer returned from 'dfamalloc()' should be dfafree'd + free'd.
A free() call is missing in one instance.

Patch attached, comments welcomed.
 - assaf
>From 4abc3de62c937752327b08b0618426ce4018363d Mon Sep 17 00:00:00 2001
From: Assaf Gordon <assafgor...@gmail.com>
Date: Wed, 1 Aug 2018 22:14:21 -0600
Subject: [PATCH] dfa: fix memory leak

* lib/dfa.c (dfafree): Add missing free() on dfa->superset.
---
 ChangeLog | 5 +++++
 lib/dfa.c | 5 ++++-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index 6af377024..5fe884826 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2018-08-01  Assaf Gordon <assafgor...@gmail.com>
+
+	dfa: fix memory leak
+	* lib/dfa.c (dfafree): Add missing free() on dfa->superset.
+
 2018-08-01  Paul Eggert  <egg...@cs.ucla.edu>
 
 	ieee754-h: new module
diff --git a/lib/dfa.c b/lib/dfa.c
index 37628fb40..e33084d8b 100644
--- a/lib/dfa.c
+++ b/lib/dfa.c
@@ -3530,7 +3530,10 @@ dfafree (struct dfa *d)
     }
 
   if (d->superset)
-    dfafree (d->superset);
+    {
+      dfafree (d->superset);
+      free (d->superset);
+    }
 }
 
 /* Having found the postfix representation of the regular expression,
-- 
2.11.0

Reply via email to