[Commits] [SCM] claws branch, master, updated. 3.17.3-160-gdc6f615

ticho at claws-mail.org ticho at claws-mail.org
Thu Apr 25 21:39:07 CEST 2019


The branch, master has been updated
       via  dc6f61518909b5ada650a4ae922276cd814f0cce (commit)
      from  d17218031565b6ab8e78ab5d24f1b16b0fa3f848 (commit)

Summary of changes:
 src/plugins/rssyl/rssyl.c          |    2 +-
 src/plugins/rssyl/rssyl_add_item.c |   14 +++++++++++---
 2 files changed, 12 insertions(+), 4 deletions(-)


- Log -----------------------------------------------------------------
commit dc6f61518909b5ada650a4ae922276cd814f0cce
Author: Andrej Kacian <ticho at claws-mail.org>
Date:   Thu Apr 25 21:38:10 2019 +0200

    Fix a memory leak in rssyl_add_item()

diff --git a/src/plugins/rssyl/rssyl.c b/src/plugins/rssyl/rssyl.c
index 410b536..e6cc6e3 100644
--- a/src/plugins/rssyl/rssyl.c
+++ b/src/plugins/rssyl/rssyl.c
@@ -811,7 +811,7 @@ static gint rssyl_add_msgs(Folder *folder, FolderItem *dest, GSList *file_list,
 	return dest->last_num;
 }
 
-static gint rssyl_add_msg(Folder *folder, FolderItem *dest, const gchar *file,
+gint rssyl_add_msg(Folder *folder, FolderItem *dest, const gchar *file,
 		MsgFlags *flags)
 {
 	GSList file_list;
diff --git a/src/plugins/rssyl/rssyl_add_item.c b/src/plugins/rssyl/rssyl_add_item.c
index 2bff270..d22e1dd 100644
--- a/src/plugins/rssyl/rssyl_add_item.c
+++ b/src/plugins/rssyl/rssyl_add_item.c
@@ -46,6 +46,9 @@
 #include "rssyl_parse_feed.h"
 #include "strutils.h"
 
+gint rssyl_add_msg(Folder *folder, FolderItem *dest, const gchar *file,
+		MsgFlags *flags);
+
 /* rssyl_cb_feed_compare()
  *
  * GCompareFunc function called by glib2's g_slist_find_custom().
@@ -560,10 +563,15 @@ void rssyl_add_item(RFolderItem *ritem, FeedItem *feed_item)
 	flags->perm_flags = MSG_NEW | MSG_UNREAD;
 	flags->tmp_flags = 0;
 
-	d = folder_item_add_msg(&ritem->item, template, flags, TRUE);
-	g_free(template);
+	d = rssyl_add_msg(ritem->item.folder, &ritem->item, template, flags);
+
 	g_free(flags);
 
+	if (claws_unlink(template) < 0)
+		FILE_OP_ERROR(template, "unlink");
+
+	g_free(template);
+
 	ctx = g_new0(RFeedCtx, 1);
 	ctx->path = (gpointer)g_strdup_printf("%s%c%d", dirname,
 			G_DIR_SEPARATOR, d);
@@ -583,5 +591,5 @@ void rssyl_add_item(RFolderItem *ritem, FeedItem *feed_item)
 		}
 	}
 
-	debug_print("RSSyl: folder_item_add_msg(): %d\n", d);
+	debug_print("RSSyl: rssyl_add_msg(): %d\n", d);
 }

-----------------------------------------------------------------------


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list