summaryrefslogtreecommitdiff
path: root/noncore/net/mail/libmailwrapper/imapwrapper.cpp
authoralwin <alwin>2003-12-24 14:18:28 (UTC)
committer alwin <alwin>2003-12-24 14:18:28 (UTC)
commit9d2a848b254d6c859d7054d486eedac6535d26ec (patch) (unidiff)
treed3cb3479465b1cc6ef4b67898fc9649f8416c3da /noncore/net/mail/libmailwrapper/imapwrapper.cpp
parentc609fd3341bccf6150e313f4fa08ff3ca9086503 (diff)
downloadopie-9d2a848b254d6c859d7054d486eedac6535d26ec.zip
opie-9d2a848b254d6c859d7054d486eedac6535d26ec.tar.gz
opie-9d2a848b254d6c859d7054d486eedac6535d26ec.tar.bz2
hopefully fixed some memleaks and some not initialized vars
Diffstat (limited to 'noncore/net/mail/libmailwrapper/imapwrapper.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/mail/libmailwrapper/imapwrapper.cpp12
1 files changed, 5 insertions, 7 deletions
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()
94 94
95void IMAPwrapper::listMessages(const QString&mailbox,QList<RecMail> &target ) 95void IMAPwrapper::listMessages(const QString&mailbox,QList<RecMail> &target )
96{ 96{
97 const char *mb; 97 const char *mb = 0;
98 int err = MAILIMAP_NO_ERROR; 98 int err = MAILIMAP_NO_ERROR;
99 clist *result; 99 clist *result = 0;
100 clistcell *current; 100 clistcell *current;
101// mailimap_fetch_att *fetchAtt,*fetchAttFlags,*fetchAttDate,*fetchAttSize; 101// mailimap_fetch_att *fetchAtt,*fetchAttFlags,*fetchAttDate,*fetchAttSize;
102 mailimap_fetch_type *fetchType; 102 mailimap_fetch_type *fetchType = 0;
103 mailimap_set *set; 103 mailimap_set *set = 0;
104 104
105 mb = mailbox.latin1(); 105 mb = mailbox.latin1();
106 login(); 106 login();
@@ -121,7 +121,6 @@ void IMAPwrapper::listMessages(const QString&mailbox,QList<RecMail> &target )
121 return; 121 return;
122 } 122 }
123 123
124 result = clist_new();
125 /* the range has to start at 1!!! not with 0!!!! */ 124 /* the range has to start at 1!!! not with 0!!!! */
126 set = mailimap_set_new_interval( 1, last ); 125 set = mailimap_set_new_interval( 1, last );
127 fetchType = mailimap_fetch_type_new_fetch_att_list_empty(); 126 fetchType = mailimap_fetch_type_new_fetch_att_list_empty();
@@ -137,7 +136,6 @@ void IMAPwrapper::listMessages(const QString&mailbox,QList<RecMail> &target )
137 QString date,subject,from; 136 QString date,subject,from;
138 137
139 if ( err == MAILIMAP_NO_ERROR ) { 138 if ( err == MAILIMAP_NO_ERROR ) {
140
141 mailimap_msg_att * msg_att; 139 mailimap_msg_att * msg_att;
142 int i = 0; 140 int i = 0;
143 for (current = clist_begin(result); current != 0; current=clist_next(current)) { 141 for (current = clist_begin(result); current != 0; current=clist_next(current)) {
@@ -154,7 +152,7 @@ void IMAPwrapper::listMessages(const QString&mailbox,QList<RecMail> &target )
154 } else { 152 } else {
155 qDebug("Error fetching headers: %s",m_imap->imap_response); 153 qDebug("Error fetching headers: %s",m_imap->imap_response);
156 } 154 }
157 mailimap_fetch_list_free(result); 155 if (result) mailimap_fetch_list_free(result);
158} 156}
159 157
160QList<Folder>* IMAPwrapper::listFolders() 158QList<Folder>* IMAPwrapper::listFolders()