Fix memory leaks introduced in recent commit 9729bf0e0.
authorAndrej Kacian <ticho@claws-mail.org>
Mon, 23 Oct 2017 16:06:27 +0000 (18:06 +0200)
committerAndrej Kacian <ticho@claws-mail.org>
Mon, 23 Oct 2017 16:06:27 +0000 (18:06 +0200)
src/etpan/nntp-thread.c
src/news.c

index fb2cdfa224573aced59b661f816f24981ccdaf2e..98713d15dee094aa0997a0534d6862e92aa96a87 100644 (file)
@@ -862,6 +862,7 @@ int nntp_threaded_xover(Folder * folder, guint32 beg, guint32 end, struct newsnn
                        debug_print("couldn't get xover for %d-%d\n", cbeg, cend);
                        if (l != NULL)
                                clist_free(l);
+                       clist_free(h);
                        return result.error;
                }
 
@@ -953,6 +954,7 @@ int nntp_threaded_xhdr(Folder * folder, const char *header, guint32 beg, guint32
                        debug_print("couldn't get xhdr %s %d-%d\n",     header, cbeg, cend);
                        if (l != NULL)
                                clist_free(l);
+                       clist_free(h);
                        return result.error;
                }
 
index ac59f0cbad0fd3931a6529e211f127265378df57..31456ce77f0a2c032aafc1a9e4dee7636704e8e4 100644 (file)
@@ -1136,6 +1136,8 @@ static void news_get_extra_fields(NewsSession *session, FolderItem *item, GSList
                        REMOTE_FOLDER(item->folder)->session = NULL;
                }
                news_folder_unlock(NEWS_FOLDER(item->folder));
+               if (hdrlist != NULL)
+                       clist_free(hdrlist);
                return;
        }
 
@@ -1161,6 +1163,8 @@ static void news_get_extra_fields(NewsSession *session, FolderItem *item, GSList
                        REMOTE_FOLDER(item->folder)->session = NULL;
                }
                news_folder_unlock(NEWS_FOLDER(item->folder));
+               if (hdrlist != NULL)
+                       clist_free(hdrlist);
                return;
        }
 
@@ -1186,6 +1190,8 @@ static void news_get_extra_fields(NewsSession *session, FolderItem *item, GSList
                        REMOTE_FOLDER(item->folder)->session = NULL;
                }
                news_folder_unlock(NEWS_FOLDER(item->folder));
+               if (hdrlist != NULL)
+                       clist_free(hdrlist);
                return;
        }
 
@@ -1237,6 +1243,8 @@ static GSList *news_get_msginfos_for_range(NewsSession *session, FolderItem *ite
                        REMOTE_FOLDER(item->folder)->session = NULL;
                }
                news_folder_unlock(NEWS_FOLDER(item->folder));
+               if (msglist != NULL)
+                       clist_free(msglist);
                return NULL;
        }