From b274c72a2b5b7b482a48b75bee15d13eecf3d8cd Mon Sep 17 00:00:00 2001 From: Andrej Kacian Date: Sat, 10 Sep 2016 00:07:01 +0200 Subject: [PATCH] Fix memory leak when freeing RSSyl's FeedItem struct. --- src/plugins/rssyl/parse822.c | 4 +++- src/plugins/rssyl/rssyl_add_item.c | 1 + src/plugins/rssyl/rssyl_deleted.c | 4 ++++ src/plugins/rssyl/rssyl_update_comments.c | 3 +++ 4 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/plugins/rssyl/parse822.c b/src/plugins/rssyl/parse822.c index ca8b8420d..c3cd10963 100644 --- a/src/plugins/rssyl/parse822.c +++ b/src/plugins/rssyl/parse822.c @@ -235,8 +235,10 @@ static void rssyl_flush_folder_func(gpointer data, gpointer user_data) FeedItem *item = (FeedItem *)data; RFeedCtx *ctx = (RFeedCtx *)item->data; - if( ctx != NULL && ctx->path != NULL) + if( ctx != NULL && ctx->path != NULL) { g_free(ctx->path); + g_free(ctx); + } feed_item_free(item); } diff --git a/src/plugins/rssyl/rssyl_add_item.c b/src/plugins/rssyl/rssyl_add_item.c index 922ad4ead..b280609a7 100644 --- a/src/plugins/rssyl/rssyl_add_item.c +++ b/src/plugins/rssyl/rssyl_add_item.c @@ -363,6 +363,7 @@ void rssyl_add_item(RFolderItem *ritem, FeedItem *feed_item) } g_free(ctx->path); + g_free(ctx); feed_item_free(old_item); old_item = NULL; } diff --git a/src/plugins/rssyl/rssyl_deleted.c b/src/plugins/rssyl/rssyl_deleted.c index 7a4aabebf..f58435605 100644 --- a/src/plugins/rssyl/rssyl_deleted.c +++ b/src/plugins/rssyl/rssyl_deleted.c @@ -235,6 +235,10 @@ void rssyl_deleted_add(RFolderItem *ritem, gchar *path) g_free(deleted_file); rssyl_deleted_free(deleted_items); + + RFeedCtx *ctx = (RFeedCtx *)fitem->data; + g_free(ctx->path); + g_free(ctx); feed_item_free(fitem); } diff --git a/src/plugins/rssyl/rssyl_update_comments.c b/src/plugins/rssyl/rssyl_update_comments.c index c60961908..8d05d6c7a 100644 --- a/src/plugins/rssyl/rssyl_update_comments.c +++ b/src/plugins/rssyl/rssyl_update_comments.c @@ -130,6 +130,9 @@ void rssyl_update_comments(RFolderItem *ritem) STATUSBAR_POP(mainwin); + RFeedCtx *ctx = (RFeedCtx *)fi->data; + g_free(ctx->path); + g_free(ctx); feed_item_free(fi); } -- 2.25.1