[pan2] Fix error found by valgrind: 6 bytes in 1 blocks are definitely lost in loss record 175 of 11, 687



commit 22e01f84c895160693de16ec12905a68b83051bd
Author: Olaf Seibert <rhialto falu nl>
Date:   Mon Mar 21 23:21:05 2016 +0100

    Fix error found by valgrind: 6 bytes in 1 blocks are definitely lost in loss record 175 of 11,687
    
       at 0x4C2BBCF: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
       by 0x6D2F578: g_malloc (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4600.2)
       by 0x6D483A7: g_strndup (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4600.2)
       by 0x55F0B5: e_strdup_strip (e-util.cc:49)
       by 0x55F0B5: EvolutionDateMaker::get_date_string(long) const (e-util.cc:290)
       by 0x55BDB6: pan::expand_attachment_headers(pan::Quark const&, pan::Article const&) 
(text-massager.cc:577)
       by 0x50E437: pan::TaskArticle::TaskArticle(pan::ServerRank const&, pan::GroupServer const&, 
pan::Article const&, pan::ArticleCache&, pan::ArticleRead&, pan::TaskArticle::ArticleActionType const&, 
pan::Progress::Listener*, pan::TaskArticle::SaveMode, pan::Quark const&, char const*, 
pan::TaskArticle::SaveOptions const&) (task-article.cc:98)
       by 0x4CBA7C: pan::SaveDialog::response_cb(_GtkDialog*, int, void*) (save-ui.cc:126)
       by 0x6A9D014: g_closure_invoke (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.4600.2)
       by 0x6AAF060: ??? (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.4600.2)
       by 0x6AB7DFB: g_signal_emit_valist (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.4600.2)

 pan/usenet-utils/text-massager.cc |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/pan/usenet-utils/text-massager.cc b/pan/usenet-utils/text-massager.cc
index 644e547..ff757a1 100644
--- a/pan/usenet-utils/text-massager.cc
+++ b/pan/usenet-utils/text-massager.cc
@@ -574,7 +574,9 @@ pan :: expand_attachment_headers(const Quark& path, const Article& article)
   std::string author_email (author.second);
 
   EvolutionDateMaker ed;
-  std::string now (ed.get_date_string (article.time_posted));
+  char *date = ed.get_date_string (article.time_posted);
+  std::string now (date);
+  g_free (date);
 
   if (author_name.empty())  author_name  = _("no_name");
   if (author_email.empty()) author_email = _("no_mail");


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