[gnome-utils/gnome-2-26] [gsearchtool] Bug 579461 -- memory leak



commit 6ecc337428ec1b6a09d22c9a0606054512b73501
Author: Dennis Cranston <Dennis_Cranston yahoo com>
Date:   Mon Apr 27 21:27:33 2009 -0700

    [gsearchtool] Bug 579461 -- memory leak
    
    gsearchtool-support.c (compare_regex): Fix memory leak.
---
 gsearchtool/ChangeLog             |    5 +++++
 gsearchtool/gsearchtool-support.c |    2 ++
 2 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/gsearchtool/ChangeLog b/gsearchtool/ChangeLog
index f369c6e..8db0b40 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-02-25  Cosimo Cecchi  <cosimoc gnome org>
 
 	* gsearchtool.h: get rid of deprecated GTK_CHECK_* macros.
diff --git a/gsearchtool/gsearchtool-support.c b/gsearchtool/gsearchtool-support.c
index 920f1f3..f7ea853 100644
--- a/gsearchtool/gsearchtool-support.c
+++ b/gsearchtool/gsearchtool-support.c
@@ -489,8 +489,10 @@ 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]