From 5a35647b7d94b54baec0b2e21b401a056bd2b06d Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Fri, 31 May 2002 22:10:13 +0000 Subject: When the part is a multipart/signed, make sure to free the part_spec 2002-05-31 Jeffrey Stedfast * providers/imap/camel-imap-folder.c (get_content): When the part is a multipart/signed, make sure to free the part_spec before returning (the other types already did this properly). svn path=/trunk/; revision=17066 --- camel/providers/imap/camel-imap-folder.c | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) (limited to 'camel/providers/imap') diff --git a/camel/providers/imap/camel-imap-folder.c b/camel/providers/imap/camel-imap-folder.c index 76ceb5a796..076066782f 100644 --- a/camel/providers/imap/camel-imap-folder.c +++ b/camel/providers/imap/camel-imap-folder.c @@ -1577,32 +1577,33 @@ get_content (CamelImapFolder *imap_folder, const char *uid, part_spec = content_info_get_part_spec (ci); /* There are three cases: multipart/signed, multipart, message/rfc822, and "other" */ - if (header_content_type_is(ci->type, "multipart", "signed")) { + if (header_content_type_is (ci->type, "multipart", "signed")) { CamelMultipartSigned *body_mp; char *spec; int ret; - + /* Note: because we get the content parts uninterpreted anyway, we could potentially just use the normalmultipart code, except that multipart/signed wont let you yet! */ - - body_mp = camel_multipart_signed_new(); + + body_mp = camel_multipart_signed_new (); /* need to set this so it grabs the boundary and other info about the signed type */ /* we assume that part->content_type is more accurate/full than ci->type */ - camel_data_wrapper_set_mime_type_field(CAMEL_DATA_WRAPPER(body_mp), part->content_type); - - spec = alloca(strlen(part_spec) + 6); - sprintf(spec, part_spec[0]?"%s.TEXT":"TEXT", part_spec); - + camel_data_wrapper_set_mime_type_field (CAMEL_DATA_WRAPPER (body_mp), part->content_type); + + spec = alloca (strlen (part_spec) + 6); + sprintf (spec, part_spec[0] ? "%s.TEXT" : "TEXT", part_spec); + g_free (part_spec); + stream = camel_imap_folder_fetch_data (imap_folder, uid, spec, FALSE, ex); if (stream) { - ret = camel_data_wrapper_construct_from_stream(CAMEL_DATA_WRAPPER(body_mp), stream); - camel_object_unref(CAMEL_OBJECT(stream)); + ret = camel_data_wrapper_construct_from_stream (CAMEL_DATA_WRAPPER (body_mp), stream); + camel_object_unref (CAMEL_OBJECT (stream)); if (ret == -1) { - camel_object_unref((CamelObject *)body_mp); + camel_object_unref ((CamelObject *) body_mp); return NULL; } } - + return (CamelDataWrapper *)body_mp; } else if (header_content_type_is (ci->type, "multipart", "*")) { CamelMultipart *body_mp; -- cgit v1.2.3