summaryrefslogtreecommitdiff
path: root/noncore/net/mail/smtpwrapper.cpp
authoralwin <alwin>2003-12-24 14:18:28 (UTC)
committer alwin <alwin>2003-12-24 14:18:28 (UTC)
commit9d2a848b254d6c859d7054d486eedac6535d26ec (patch) (side-by-side diff)
treed3cb3479465b1cc6ef4b67898fc9649f8416c3da /noncore/net/mail/smtpwrapper.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/smtpwrapper.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/mail/smtpwrapper.cpp33
1 files changed, 23 insertions, 10 deletions
diff --git a/noncore/net/mail/smtpwrapper.cpp b/noncore/net/mail/smtpwrapper.cpp
index a7e4837..21992b4 100644
--- a/noncore/net/mail/smtpwrapper.cpp
+++ b/noncore/net/mail/smtpwrapper.cpp
@@ -443,3 +443,5 @@ char *SMTPwrapper::getFrom( mailmime *mail )
{
+ /* no need to delete - its just a pointer to structure content */
mailimf_field *ffrom = 0;
+ char*f = 0;
ffrom = getField( mail->mm_data.mm_message.mm_fields, MAILIMF_FIELD_FROM );
@@ -565,2 +567,5 @@ void SMTPwrapper::smtpSend( mailmime *mail,bool later, SMTPaccount *smtp )
smtpSend(from,rcpts,data,size,smtp);
+ if (data) {free(data);}
+ if (from) {free(from);}
+ if (rcpts) smtp_address_list_free( rcpts );
}
@@ -632,6 +637,3 @@ free_mem_session:
free_mem:
- if (rcpts) smtp_address_list_free( rcpts );
- if (data) free( data );
if (server) free( server );
- if (from) free( from );
if ( smtp->getLogin() ) {
@@ -654,3 +656,2 @@ void SMTPwrapper::sendMail(const Mail&mail,bool later )
sendProgress = new progressMailSend();
-// sendProgress->showMaximized();
sendProgress->show();
@@ -675,2 +676,3 @@ int SMTPwrapper::sendQueuedMail(MBOXwrapper*wrap,SMTPaccount*smtp,RecMail*which)
char*from = 0;
+ int res = 0;
@@ -691,5 +693,18 @@ int SMTPwrapper::sendQueuedMail(MBOXwrapper*wrap,SMTPaccount*smtp,RecMail*which)
if (rcpts && from) {
- return smtpSend(from,rcpts,data,strlen(data),smtp );
+ res = smtpSend(from,rcpts,data,length,smtp );
}
- return 0;
+ if (fields) {
+ mailimf_fields_free(fields);
+ fields = 0;
+ }
+ if (data) {
+ free(data);
+ }
+ if (from) {
+ free(from);
+ }
+ if (rcpts) {
+ smtp_address_list_free( rcpts );
+ }
+ return res;
}
@@ -719,5 +734,4 @@ bool SMTPwrapper::flushOutbox(SMTPaccount*smtp)
sendProgress = new progressMailSend();
-// sendProgress->showMaximized();
- sendProgress->show();
- sendProgress->setMaxMails(mailsToSend.count());
+ sendProgress->show();
+ sendProgress->setMaxMails(mailsToSend.count());
@@ -742,3 +756,2 @@ bool SMTPwrapper::flushOutbox(SMTPaccount*smtp)
return returnValue;
-
}