[pan2] Fix error found by valgrind: 252 (216 direct, 36 indirect) bytes in 3 blocks are definitely lost in



commit 83cd963dd8ca7b1637bd9e1f2dd095900944ebb6
Author: Olaf Seibert <rhialto falu nl>
Date:   Mon Mar 14 21:04:26 2016 +0100

    Fix error found by valgrind: 252 (216 direct, 36 indirect) bytes in 3 blocks are definitely lost in loss 
record 10,175 of 10,810
    
       at 0x4C2DB95: calloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
       by 0x6D2F5D0: g_malloc0 (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4600.2)
       by 0x6D3D2D3: ??? (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4600.2)
       by 0x6D3DA20: g_regex_match_full (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4600.2)
       by 0x6D3DB79: g_regex_match (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4600.2)
       by 0x55D298: pan::url_find(pan::StringView const&, pan::StringView&) (url-find.cc:68)
       by 0x47CB5E: append_text_buffer_nolock (body-pane.cc:884)
       by 0x47CB5E: pan::BodyPane::append_part(_GMimeObject*, _GMimeObject*, _GdkRectangle*) 
(body-pane.cc:1047)
       by 0x47D8EF: pan::BodyPane::foreach_part_cb(_GMimeObject*, _GMimeObject*, void*) (body-pane.cc:1071)
       by 0x7904CD1: g_mime_message_foreach (in /usr/lib/x86_64-linux-gnu/libgmime-2.6.so.0.620.0)
       by 0x47E3AB: pan::BodyPane::set_text_from_message(_GMimeMessage*) (body-pane.cc:1268)
       by 0x47EDF5: refresh (body-pane.cc:1293)
       by 0x47EDF5: pan::BodyPane::set_article(pan::Article const&) (body-pane.cc:1349)
       by 0x469850: on_progress_finished (gui.cc:1005)
       by 0x469850: non-virtual thunk to pan::GUI::on_progress_finished(pan::Progress&, int) (gui.cc:1000)

 pan/usenet-utils/url-find.cc |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/pan/usenet-utils/url-find.cc b/pan/usenet-utils/url-find.cc
index 58fcc93..28ef4c8 100644
--- a/pan/usenet-utils/url-find.cc
+++ b/pan/usenet-utils/url-find.cc
@@ -63,10 +63,12 @@ pan :: url_find (const StringView& text, StringView& setme_url)
   if (text.empty())
     return false;
 
-  GMatchInfo *match;
+  GMatchInfo *match = NULL;
 
-  if (!g_regex_match(regex, text.str, (GRegexMatchFlags)0, &match))
+  if (!g_regex_match(regex, text.str, (GRegexMatchFlags)0, &match)) {
+    g_match_info_free(match);
     return false;
+  }
 
   int start,end;
 


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