[balsa] Do not unref NULL NetClientPop object



commit 42bcfa1aff595c16b5f845427559a125bcf8af77
Author: Albrecht Dreß <albrecht dress arcor de>
Date:   Sun Apr 9 19:09:03 2017 -0400

    Do not unref NULL NetClientPop object
    
        * libbalsa/mailbox_pop3.c (libbalsa_mailbox_pop3_check): do not
        unref NULL NetClientPop object.
    
    Signed-off-by: Peter Bloomfield <PeterBloomfield bellsouth net>

 ChangeLog               |    5 +++++
 libbalsa/mailbox_pop3.c |    9 +++++----
 2 files changed, 10 insertions(+), 4 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 5a099d8..a61004d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2017-04-09  Albrecht Dreß
 
+       * libbalsa/mailbox_pop3.c (libbalsa_mailbox_pop3_check): do not
+       unref NULL NetClientPop object.
+
+2017-04-09  Albrecht Dreß
+
        * libnetclient/net-client.c (net_client_new): do not return
        pointer to finalized object.
 
diff --git a/libbalsa/mailbox_pop3.c b/libbalsa/mailbox_pop3.c
index 8a4c099..c7a1924 100644
--- a/libbalsa/mailbox_pop3.c
+++ b/libbalsa/mailbox_pop3.c
@@ -656,6 +656,7 @@ libbalsa_mailbox_pop3_check(LibBalsaMailbox * mailbox)
                        if (result) {
                                result = net_client_pop_retr(pop, msg_list, message_cb, &fd, &err);
                                if (result && mbox->delete_from_server) {
+                                       libbalsa_mailbox_progress_notify(mailbox, LIBBALSA_NTFY_PROGRESS, 1, 
1, _("Deleting messages on server…"));
                                        result = net_client_pop_dele(pop, msg_list, &err);
                                }
                        }
@@ -680,11 +681,11 @@ libbalsa_mailbox_pop3_check(LibBalsaMailbox * mailbox)
                        libbalsa_information(LIBBALSA_INFORMATION_ERROR, _("POP3 error: %s"), err->message);
                        g_error_free(err);
                }
-       }
 
-       /* done - clean up */
-       libbalsa_mailbox_progress_notify(mailbox, LIBBALSA_NTFY_PROGRESS, 0, 1, _("Finished"));
-       g_object_unref(G_OBJECT(pop));
+               /* done - clean up */
+               libbalsa_mailbox_progress_notify(mailbox, LIBBALSA_NTFY_PROGRESS, 0, 1, _("Finished"));
+               g_object_unref(G_OBJECT(pop));
+       }
 }
 
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]