[IMAPX] Fix a memory leak around imapx_untagged_vanished()
authorMilan Crha <mcrha@redhat.com>
Tue, 12 Mar 2013 09:07:01 +0000 (10:07 +0100)
committerMilan Crha <mcrha@redhat.com>
Tue, 12 Mar 2013 09:07:01 +0000 (10:07 +0100)
camel/camel-imapx-server.c
camel/camel-imapx-utils.c

index 0bcef82..095ee9a 100644 (file)
@@ -1636,7 +1636,7 @@ imapx_untagged_vanished (CamelIMAPXServer *is,
        uid_list = g_list_reverse (uid_list);
        camel_folder_summary_remove_uids (folder->summary, uid_list);
        is->expunged = g_list_concat (is->expunged, uid_list);
-       g_ptr_array_free (uids, FALSE);
+       g_ptr_array_free (uids, TRUE);
 
        g_object_unref (folder);
 
index d851e5f..1431ab6 100644 (file)
@@ -1712,7 +1712,7 @@ imapx_parse_uids (CamelIMAPXStream *is,
                   GCancellable *cancellable,
                   GError **error)
 {
-       GPtrArray *uids = g_ptr_array_new ();
+       GPtrArray *uids;
        guchar *token;
        gchar **splits;
        guint len, str_len;
@@ -1722,6 +1722,7 @@ imapx_parse_uids (CamelIMAPXStream *is,
        if (tok < 0)
                return NULL;
 
+       uids = g_ptr_array_new ();
        splits = g_strsplit ((gchar *) token, ",", -1);
        str_len = g_strv_length (splits);