From 9d2a848b254d6c859d7054d486eedac6535d26ec Mon Sep 17 00:00:00 2001 From: alwin Date: Wed, 24 Dec 2003 14:18:28 +0000 Subject: hopefully fixed some memleaks and some not initialized vars --- (limited to 'noncore/net/mail/libmailwrapper/imapwrapper.cpp') diff --git a/noncore/net/mail/libmailwrapper/imapwrapper.cpp b/noncore/net/mail/libmailwrapper/imapwrapper.cpp index 853e4a2..0178e33 100644 --- a/noncore/net/mail/libmailwrapper/imapwrapper.cpp +++ b/noncore/net/mail/libmailwrapper/imapwrapper.cpp @@ -94,13 +94,13 @@ void IMAPwrapper::logout() void IMAPwrapper::listMessages(const QString&mailbox,QList &target ) { - const char *mb; + const char *mb = 0; int err = MAILIMAP_NO_ERROR; - clist *result; + clist *result = 0; clistcell *current; // mailimap_fetch_att *fetchAtt,*fetchAttFlags,*fetchAttDate,*fetchAttSize; - mailimap_fetch_type *fetchType; - mailimap_set *set; + mailimap_fetch_type *fetchType = 0; + mailimap_set *set = 0; mb = mailbox.latin1(); login(); @@ -121,7 +121,6 @@ void IMAPwrapper::listMessages(const QString&mailbox,QList &target ) return; } - result = clist_new(); /* the range has to start at 1!!! not with 0!!!! */ set = mailimap_set_new_interval( 1, last ); fetchType = mailimap_fetch_type_new_fetch_att_list_empty(); @@ -137,7 +136,6 @@ void IMAPwrapper::listMessages(const QString&mailbox,QList &target ) QString date,subject,from; if ( err == MAILIMAP_NO_ERROR ) { - mailimap_msg_att * msg_att; int i = 0; for (current = clist_begin(result); current != 0; current=clist_next(current)) { @@ -154,7 +152,7 @@ void IMAPwrapper::listMessages(const QString&mailbox,QList &target ) } else { qDebug("Error fetching headers: %s",m_imap->imap_response); } - mailimap_fetch_list_free(result); + if (result) mailimap_fetch_list_free(result); } QList* IMAPwrapper::listFolders() -- cgit v0.9.0.2