зеркало из https://github.com/mozilla/pjs.git
117858, 117859 r=ducarroz sr=bienvenu. fix leaking char* on reading messages
This commit is contained in:
Родитель
93ca321d50
Коммит
390ab2830a
|
@ -126,12 +126,12 @@ MimeExternalObject_parse_begin (MimeObject *obj)
|
|||
char *id = 0;
|
||||
char *id_url = 0;
|
||||
char *id_name = 0;
|
||||
char *id_imap = 0;
|
||||
nsXPIDLCString id_imap;
|
||||
PRBool all_headers_p = obj->options->headers == MimeHeadersAll;
|
||||
|
||||
id = mime_part_address (obj);
|
||||
if (obj->options->missing_parts)
|
||||
id_imap = mime_imap_part_address (obj);
|
||||
id_imap.Adopt(mime_imap_part_address (obj));
|
||||
if (! id) return MIME_OUT_OF_MEMORY;
|
||||
|
||||
if (obj->options && obj->options->url)
|
||||
|
@ -140,7 +140,7 @@ MimeExternalObject_parse_begin (MimeObject *obj)
|
|||
if (id_imap && id)
|
||||
{
|
||||
// if this is an IMAP part.
|
||||
id_url = mime_set_url_imap_part(url, id_imap, id);
|
||||
id_url = mime_set_url_imap_part(url, id_imap.get(), id);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -187,7 +187,6 @@ MimeExternalObject_parse_begin (MimeObject *obj)
|
|||
|
||||
newopt.fancy_headers_p = PR_TRUE;
|
||||
newopt.headers = (all_headers_p ? MimeHeadersAll : MimeHeadersSome);
|
||||
PR_FREEIF(id_name);
|
||||
|
||||
/******
|
||||
RICHIE SHERRY
|
||||
|
|
|
@ -386,21 +386,21 @@ MimeMultipartSigned_parse_line (char *line, PRInt32 length, MimeObject *obj)
|
|||
*/
|
||||
{
|
||||
MimeDecoderData *(*fn) (nsresult (*) (const char*, PRInt32,void*), void*) = 0;
|
||||
char *encoding = MimeHeaders_get (sig->sig_hdrs,
|
||||
HEADER_CONTENT_TRANSFER_ENCODING,
|
||||
PR_TRUE, PR_FALSE);
|
||||
if (!encoding)
|
||||
;
|
||||
else if (!nsCRT::strcasecmp(encoding, ENCODING_BASE64))
|
||||
fn = &MimeB64DecoderInit;
|
||||
else if (!nsCRT::strcasecmp(encoding, ENCODING_QUOTED_PRINTABLE))
|
||||
fn = &MimeQPDecoderInit;
|
||||
else if (!nsCRT::strcasecmp(encoding, ENCODING_UUENCODE) ||
|
||||
!nsCRT::strcasecmp(encoding, ENCODING_UUENCODE2) ||
|
||||
!nsCRT::strcasecmp(encoding, ENCODING_UUENCODE3) ||
|
||||
!nsCRT::strcasecmp(encoding, ENCODING_UUENCODE4))
|
||||
fn = &MimeUUDecoderInit;
|
||||
|
||||
nsXPIDLCString encoding;
|
||||
encoding.Adopt(MimeHeaders_get (sig->sig_hdrs,
|
||||
HEADER_CONTENT_TRANSFER_ENCODING,
|
||||
PR_TRUE, PR_FALSE));
|
||||
if (encoding.IsEmpty())
|
||||
;
|
||||
else if (!nsCRT::strcasecmp(encoding.get(), ENCODING_BASE64))
|
||||
fn = &MimeB64DecoderInit;
|
||||
else if (!nsCRT::strcasecmp(encoding.get(), ENCODING_QUOTED_PRINTABLE))
|
||||
fn = &MimeQPDecoderInit;
|
||||
else if (!nsCRT::strcasecmp(encoding.get(), ENCODING_UUENCODE) ||
|
||||
!nsCRT::strcasecmp(encoding.get(), ENCODING_UUENCODE2) ||
|
||||
!nsCRT::strcasecmp(encoding.get(), ENCODING_UUENCODE3) ||
|
||||
!nsCRT::strcasecmp(encoding.get(), ENCODING_UUENCODE4))
|
||||
fn = &MimeUUDecoderInit;
|
||||
if (fn)
|
||||
{
|
||||
sig->sig_decoder_data =
|
||||
|
|
Загрузка…
Ссылка в новой задаче