More and better leak fixes after commit 9729bf0e0.
authorAndrej Kacian <ticho@claws-mail.org>
Mon, 23 Oct 2017 16:57:50 +0000 (18:57 +0200)
committerAndrej Kacian <ticho@claws-mail.org>
Mon, 23 Oct 2017 16:57:50 +0000 (18:57 +0200)
src/etpan/nntp-thread.c
src/news.c

index 98713d1..cebdf69 100644 (file)
@@ -861,8 +861,8 @@ int nntp_threaded_xover(Folder * folder, guint32 beg, guint32 end, struct newsnn
                        log_warning(LOG_PROTOCOL, _("couldn't get xover range\n"));
                        debug_print("couldn't get xover for %d-%d\n", cbeg, cend);
                        if (l != NULL)
-                               clist_free(l);
-                       clist_free(h);
+                               newsnntp_xover_resp_list_free(l);
+                       newsnntp_xover_resp_list_free(h);
                        return result.error;
                }
 
@@ -871,6 +871,7 @@ int nntp_threaded_xover(Folder * folder, guint32 beg, guint32 end, struct newsnn
                        debug_print("total items so far %d, items this batch %d\n",
                                        clist_count(h), clist_count(l));
                        clist_concat(h, l);
+                       clist_free(l);
                        l = NULL;
                }
 
@@ -953,8 +954,8 @@ int nntp_threaded_xhdr(Folder * folder, const char *header, guint32 beg, guint32
                        log_warning(LOG_PROTOCOL, _("couldn't get xhdr range\n"));
                        debug_print("couldn't get xhdr %s %d-%d\n",     header, cbeg, cend);
                        if (l != NULL)
-                               clist_free(l);
-                       clist_free(h);
+                               newsnntp_xhdr_free(l);
+                       newsnntp_xhdr_free(h);
                        return result.error;
                }
 
@@ -963,6 +964,7 @@ int nntp_threaded_xhdr(Folder * folder, const char *header, guint32 beg, guint32
                        debug_print("total items so far %d, items this batch %d\n",
                                        clist_count(h), clist_count(l));
                        clist_concat(h, l);
+                       clist_free(l);
                        l = NULL;
                }
 
index 31456ce..c062ac3 100644 (file)
@@ -1137,7 +1137,7 @@ static void news_get_extra_fields(NewsSession *session, FolderItem *item, GSList
                }
                news_folder_unlock(NEWS_FOLDER(item->folder));
                if (hdrlist != NULL)
-                       clist_free(hdrlist);
+                       newsnntp_xhdr_free(hdrlist);
                return;
        }
 
@@ -1164,7 +1164,7 @@ static void news_get_extra_fields(NewsSession *session, FolderItem *item, GSList
                }
                news_folder_unlock(NEWS_FOLDER(item->folder));
                if (hdrlist != NULL)
-                       clist_free(hdrlist);
+                       newsnntp_xhdr_free(hdrlist);
                return;
        }
 
@@ -1191,7 +1191,7 @@ static void news_get_extra_fields(NewsSession *session, FolderItem *item, GSList
                }
                news_folder_unlock(NEWS_FOLDER(item->folder));
                if (hdrlist != NULL)
-                       clist_free(hdrlist);
+                       newsnntp_xhdr_free(hdrlist);
                return;
        }
 
@@ -1244,7 +1244,7 @@ static GSList *news_get_msginfos_for_range(NewsSession *session, FolderItem *ite
                }
                news_folder_unlock(NEWS_FOLDER(item->folder));
                if (msglist != NULL)
-                       clist_free(msglist);
+                       newsnntp_xover_resp_list_free(msglist);
                return NULL;
        }