Diffstat (limited to 'noncore/net/mail/smtpwrapper.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/net/mail/smtpwrapper.cpp | 29 |
1 files changed, 21 insertions, 8 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,3 +734,2 @@ bool SMTPwrapper::flushOutbox(SMTPaccount*smtp) sendProgress = new progressMailSend(); -// sendProgress->showMaximized(); sendProgress->show(); @@ -742,3 +756,2 @@ bool SMTPwrapper::flushOutbox(SMTPaccount*smtp) return returnValue; - } |