[gnome-utils] 2009-04-26 Dennis Cranston <dennis_cranston yahoo com>



commit 51bf5666cd04acfa3a0afec5fa53dbb6b2f09acd
Author: Dennis Cranston <Dennis_Cranston yahoo com>
Date:   Sun Apr 26 22:27:00 2009 -0700

    2009-04-26  Dennis Cranston  <dennis_cranston yahoo com>
    
    	* gsearchtool-support.c (compare_regex):  Fix memory leak.
    	Bug 579461.
---
 gsearchtool/ChangeLog             |    5 +++++
 gsearchtool/gsearchtool-support.c |    2 ++
 2 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/gsearchtool/ChangeLog b/gsearchtool/ChangeLog
index 8fd6d42..28b3fbe 100644
--- a/gsearchtool/ChangeLog
+++ b/gsearchtool/ChangeLog
@@ -1,3 +1,8 @@
+2009-04-26  Dennis Cranston  <dennis_cranston yahoo com>
+
+	* gsearchtool-support.c (compare_regex):  Fix memory leak.
+	Bug 579461.
+
 2009-03-29  Dennis Cranston  <dennis_cranston yahoo com>
 
 	* gsearchtool.c (setup_case_insensitive_arguments): If grep
diff --git a/gsearchtool/gsearchtool-support.c b/gsearchtool/gsearchtool-support.c
index bbf27fb..dcc8d2a 100644
--- a/gsearchtool/gsearchtool-support.c
+++ b/gsearchtool/gsearchtool-support.c
@@ -500,9 +500,11 @@ compare_regex (const gchar * regex,
 
 	if (!regcomp (&regexec_pattern, regex, REG_EXTENDED|REG_NOSUB)) {
 		if (regexec (&regexec_pattern, string, 0, 0, 0) != REG_NOMATCH) {
+			regfree (&regexec_pattern);
 			return TRUE;
 		}
 	}
+	regfree (&regexec_pattern);
 	return FALSE;
 }
 



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