Fix memory leak when freeing RSSyl's FeedItem struct.
authorAndrej Kacian <ticho@claws-mail.org>
Fri, 9 Sep 2016 22:07:01 +0000 (00:07 +0200)
committerAndrej Kacian <ticho@claws-mail.org>
Fri, 9 Sep 2016 22:07:01 +0000 (00:07 +0200)
src/plugins/rssyl/parse822.c
src/plugins/rssyl/rssyl_add_item.c
src/plugins/rssyl/rssyl_deleted.c
src/plugins/rssyl/rssyl_update_comments.c

index ca8b842..c3cd109 100644 (file)
@@ -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);
 }
 
index 922ad4e..b280609 100644 (file)
@@ -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;
        }
index 7a4aabe..f584356 100644 (file)
@@ -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);
 }
 
index c609619..8d05d6c 100644 (file)
@@ -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);
                        }