grep-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

grep branch, master, updated. v2.21-83-gc72e452


From: Jim Meyering
Subject: grep branch, master, updated. v2.21-83-gc72e452
Date: Mon, 26 Oct 2015 15:08:49 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "grep".

The branch, master has been updated
       via  c72e452c5ebffb6e6d744e5f8b91ca0c212c5d7f (commit)
      from  fbc5a95ee7084b2076d9b00c1458613fd3d582a6 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit/grep.git/commit/?id=c72e452c5ebffb6e6d744e5f8b91ca0c212c5d7f


commit c72e452c5ebffb6e6d744e5f8b91ca0c212c5d7f
Author: Zev Weiss <address@hidden>
Date:   Sun Oct 25 21:59:32 2015 -0500

    dfa: plug a memory leak in dfamust
    
    * src/dfa.c (dfamust): Ensure MP is freed, by refraining
    from returning early when, at "done:" *RESULT is NULL.

diff --git a/src/dfa.c b/src/dfa.c
index c1a00f8..856a886 100644
--- a/src/dfa.c
+++ b/src/dfa.c
@@ -4146,15 +4146,17 @@ dfamust (struct dfa const *d)
           break;
         }
     }
-done:
-  if (!*result)
-    return NULL;
-
-  struct dfamust *dm = xmalloc (sizeof *dm);
-  dm->exact = exact;
-  dm->begline = begline;
-  dm->endline = endline;
-  dm->must = xstrdup (result);
+ done:;
+
+  struct dfamust *dm = NULL;
+  if (*result)
+    {
+      dm = xmalloc (sizeof *dm);
+      dm->exact = exact;
+      dm->begline = begline;
+      dm->endline = endline;
+      dm->must = xstrdup (result);
+    }
 
   while (mp)
     {

-----------------------------------------------------------------------

Summary of changes:
 src/dfa.c |   20 +++++++++++---------
 1 files changed, 11 insertions(+), 9 deletions(-)


hooks/post-receive
-- 
grep



reply via email to

[Prev in Thread] Current Thread [Next in Thread]