[evolution-ews] unref msg on exit in ews_update_mgtrequest_mime_calendar_itemid()
- From: David Woodhouse <dwmw2 src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-ews] unref msg on exit in ews_update_mgtrequest_mime_calendar_itemid()
- Date: Mon, 16 May 2011 10:26:07 +0000 (UTC)
commit 04d0e4affdbba1b3186cb474c9359ed80c97f469
Author: David Woodhouse <David Woodhouse intel com>
Date: Mon May 16 10:12:46 2011 +0100
unref msg on exit in ews_update_mgtrequest_mime_calendar_itemid()
We were unreffing the mimeparser on exit, but not the msg. Be consistent.
src/camel/camel-ews-folder.c | 17 +++++++----------
1 files changed, 7 insertions(+), 10 deletions(-)
---
diff --git a/src/camel/camel-ews-folder.c b/src/camel/camel-ews-folder.c
index 434b3c7..84e9bcc 100644
--- a/src/camel/camel-ews-folder.c
+++ b/src/camel/camel-ews-folder.c
@@ -165,7 +165,7 @@ ews_update_mgtrequest_mime_calendar_itemid (const gchar* mime_fname, const gchar
if (camel_mime_parser_init_with_fd (mimeparser, fd_old) == -1) {
g_set_error (error, CAMEL_ERROR, CAMEL_ERROR_GENERIC,
_("Unable to generate parser from mimecontent!"));
- goto exit;
+ goto exit_parser;
}
msg = camel_mime_message_new ();
@@ -173,8 +173,7 @@ ews_update_mgtrequest_mime_calendar_itemid (const gchar* mime_fname, const gchar
mimeparser, EVO3(NULL,) error) == -1) {
g_set_error (error, CAMEL_ERROR, CAMEL_ERROR_GENERIC,
_("Unable to parse meeting request mimecontent!"));
- g_object_unref(msg);
- goto exit;
+ goto exit_msg;
}
dw = camel_medium_get_content (CAMEL_MEDIUM (msg));
@@ -189,8 +188,7 @@ ews_update_mgtrequest_mime_calendar_itemid (const gchar* mime_fname, const gchar
if (!mimepart) {
g_set_error (error, CAMEL_ERROR, CAMEL_ERROR_GENERIC,
_("Unable to get mimepart!"));
- g_object_unref (msg);
- goto exit;
+ goto exit_msg;
}
datawrapper = camel_medium_get_content (CAMEL_MEDIUM (mimepart));
@@ -252,8 +250,7 @@ ews_update_mgtrequest_mime_calendar_itemid (const gchar* mime_fname, const gchar
g_free (dir);
g_free (mime_fname_new);
mime_fname_new = NULL;
- g_object_unref (msg);
- goto exit;
+ goto exit_msg;
}
newstream = camel_stream_fs_new_with_fd (fd);
// Dump updated message data to the stream
@@ -261,15 +258,15 @@ ews_update_mgtrequest_mime_calendar_itemid (const gchar* mime_fname, const gchar
// Flush stream to its backend store
camel_stream_flush (newstream, EVO3(NULL,) error);
camel_stream_close (newstream, EVO3(NULL,) error);
- g_object_unref (msg);
g_free (dir);
close (fd);
fd = -1;
// remove original file
g_remove (mime_fname);
}
-
-exit:
+ exit_msg:
+ g_object_unref (msg);
+ exit_parser:
g_object_unref (mimeparser);
close (fd_old);
fd_old = -1;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]