[pan2] fixed mem leak with new regex



commit 014d082577e76cc0945dde38e438ad91e0394523
Author: Heinrich MÃller <henmull src gnome org>
Date:   Mon Jul 9 19:36:58 2012 +0200

    fixed mem leak with new regex

 pan/gui/task-pane.cc |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/pan/gui/task-pane.cc b/pan/gui/task-pane.cc
index 9a730b4..883b23b 100644
--- a/pan/gui/task-pane.cc
+++ b/pan/gui/task-pane.cc
@@ -894,8 +894,11 @@ namespace
           GRegexMatchFlags mf0((GRegexMatchFlags)0);
           GRegex* rex = g_regex_new (search_text.c_str(), cf0, mf0, NULL);
           if (!rex) return false;
-          return g_regex_match (rex, ta->get_article().subject.c_str(), G_REGEX_MATCH_NOTEMPTY, NULL) ||
-                  g_regex_match (rex, ta->get_article().author.c_str(), G_REGEX_MATCH_NOTEMPTY, NULL);
+          const bool match =
+            g_regex_match (rex, ta->get_article().subject.c_str(), G_REGEX_MATCH_NOTEMPTY, NULL) ||
+            g_regex_match (rex, ta->get_article().author.c_str(), G_REGEX_MATCH_NOTEMPTY, NULL);
+          g_regex_unref(rex);
+          return match;
        }
        if (search_mode == 2)
         s1 = ta->get_article().subject.c_str();



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