aboutsummaryrefslogtreecommitdiffstats
path: root/camel/camel-multipart.c
diff options
context:
space:
mode:
authorbertrand <Bertrand.Guiheneuf@aful.org>1999-08-18 01:44:00 +0800
committerBertrand Guiheneuf <bertrand@src.gnome.org>1999-08-18 01:44:00 +0800
commit08752e1b538c47f74714199eed76e9cda61c256f (patch)
tree225c875e5cdf011966498dd0540c75066609fe29 /camel/camel-multipart.c
parent8efa5bea5494312b98c70c347cc7df84564eb86f (diff)
downloadgsoc2013-evolution-08752e1b538c47f74714199eed76e9cda61c256f.tar
gsoc2013-evolution-08752e1b538c47f74714199eed76e9cda61c256f.tar.gz
gsoc2013-evolution-08752e1b538c47f74714199eed76e9cda61c256f.tar.bz2
gsoc2013-evolution-08752e1b538c47f74714199eed76e9cda61c256f.tar.lz
gsoc2013-evolution-08752e1b538c47f74714199eed76e9cda61c256f.tar.xz
gsoc2013-evolution-08752e1b538c47f74714199eed76e9cda61c256f.tar.zst
gsoc2013-evolution-08752e1b538c47f74714199eed76e9cda61c256f.zip
return the number of bytes read. How can this have ever worked ?
1999-08-17 bertrand <Bertrand.Guiheneuf@aful.org> * camel/camel-stream.c (camel_stream_read): return the number of bytes read. How can this have ever worked ? (camel_stream_flush): don't return anything. * camel/gmime-utils.c (get_header_table_from_stream): mem leak fixed. + various other mem leaks. svn path=/trunk/; revision=1120
Diffstat (limited to 'camel/camel-multipart.c')
-rw-r--r--camel/camel-multipart.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/camel/camel-multipart.c b/camel/camel-multipart.c
index 17f79cdd97..205e33c54b 100644
--- a/camel/camel-multipart.c
+++ b/camel/camel-multipart.c
@@ -220,7 +220,7 @@ _remove_part_at (CamelMultipart *multipart, guint index)
if (!(multipart->parts)) {
CAMEL_LOG_FULL_DEBUG ("CamelMultipart::remove_part_at part list is void \n");
- return;
+ return NULL;
}
parts_list = multipart->parts;
@@ -337,7 +337,7 @@ _get_boundary (CamelMultipart *multipart)
CAMEL_LOG_FULL_DEBUG ("Entering CamelMultipart::_get_boundary\n");
if (!CAMEL_DATA_WRAPPER (multipart)->mime_type) {
CAMEL_LOG_WARNING ("CamelMultipart::_get_boundary CAMEL_DATA_WRAPPER (multipart)->mime_type is NULL\n");
- return;
+ return NULL;
}
boundary = gmime_content_field_get_parameter (CAMEL_DATA_WRAPPER (multipart)->mime_type, "boundary");
CAMEL_LOG_FULL_DEBUG ("Leaving CamelMultipart::_get_boundary\n");
@@ -415,7 +415,7 @@ _write_to_stream (CamelDataWrapper *data_wrapper, CamelStream *stream)
static gboolean
_read_part (CamelStream *new_part_stream, CamelStream *stream, gchar *normal_boundary, gchar *end_boundary)
{
- gchar *new_line;
+ gchar *new_line = NULL;
gboolean end_of_part = FALSE;
gboolean last_part = FALSE;
gboolean first_line = TRUE;
@@ -436,10 +436,12 @@ _read_part (CamelStream *new_part_stream, CamelStream *stream, gchar *normal_bou
first_line = FALSE;
camel_stream_write_string (new_part_stream, new_line);
} else camel_stream_write_strings (new_part_stream, "\n", new_line, NULL);
-
+ g_free (new_line);
new_line = gmime_read_line_from_stream (stream);
}
}
+ if (new_line) g_free (new_line);
+
CAMEL_LOG_FULL_DEBUG ("CamelMultipart:: Leaving _read_part\n");
return (last_part || (new_line == NULL));
}
@@ -466,7 +468,8 @@ _construct_from_stream (CamelDataWrapper *data_wrapper, CamelStream *stream)
/* read the prefix if any */
new_part_stream = camel_stream_mem_new (CAMEL_STREAM_MEM_RW);
end_of_multipart = _read_part (new_part_stream, stream, real_boundary_line, end_boundary_line);
- gtk_object_destroy (GTK_OBJECT (new_part_stream));
+ CAMEL_LOG_FULL_DEBUG ("CamelMultipart::construct_from_stream freeing new_part_stream:%p\n", new_part_stream);
+ gtk_object_unref (GTK_OBJECT (new_part_stream));
if (multipart->preface) g_free (multipart->preface);
//if ( (new_part->str)[0] != '\0') multipart->preface = g_strdup (new_part->str);