GNU bug report logs - #17341
memory leak in dfa.c

Previous Next

Package: grep;

Reported by: Aharon Robbins <arnold <at> skeeve.com>

Date: Fri, 25 Apr 2014 03:23:02 UTC

Severity: normal

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 17341 in the body.
You can then email your comments to 17341 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-grep <at> gnu.org:
bug#17341; Package grep. (Fri, 25 Apr 2014 03:23:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Aharon Robbins <arnold <at> skeeve.com>:
New bug report received and forwarded. Copy sent to bug-grep <at> gnu.org. (Fri, 25 Apr 2014 03:23:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Aharon Robbins <arnold <at> skeeve.com>
To: bug-grep <at> gnu.org
Subject: memory leak in dfa.c
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;
 }




Reply sent to Paul Eggert <eggert <at> cs.ucla.edu>:
You have taken responsibility. (Fri, 25 Apr 2014 06:31:02 GMT) Full text and rfc822 format available.

Notification sent to Aharon Robbins <arnold <at> skeeve.com>:
bug acknowledged by developer. (Fri, 25 Apr 2014 06:31:04 GMT) Full text and rfc822 format available.

Message #10 received at 17341-done <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Aharon Robbins <arnold <at> skeeve.com>, 17341-done <at> debbugs.gnu.org
Subject: Re: bug#17341: memory leak in dfa.c
Date: Thu, 24 Apr 2014 23:30:36 -0700
Thanks, I merged that into the master version.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 23 May 2014 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 10 years and 1 day ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.