[evolution-data-server/gnome-3-10] CamelPOP3Folder: Fix a potential g_object_unref(NULL) call
- From: Matthew Barnes <mbarnes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-data-server/gnome-3-10] CamelPOP3Folder: Fix a potential g_object_unref(NULL) call
- Date: Wed, 4 Dec 2013 01:27:39 +0000 (UTC)
commit 3df0d7608cb03375ae8bf365807bb64844e30c7c
Author: Philip Withnall <philip withnall collabora co uk>
Date: Tue Dec 3 14:55:29 2013 -0500
CamelPOP3Folder: Fix a potential g_object_unref(NULL) call
If all the branch conditions in this function evaluate to FALSE, the
stream is never set, and hence g_object_unref(NULL) is called on exiting
the function.
Found by scan-build.
https://bugzilla.gnome.org/719533
(cherry picked from commit 1161f3fbc1f6018fbc163b2f3078c5938f983c19)
camel/providers/pop3/camel-pop3-folder.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/camel/providers/pop3/camel-pop3-folder.c b/camel/providers/pop3/camel-pop3-folder.c
index 93988aa..8f9b6c7 100644
--- a/camel/providers/pop3/camel-pop3-folder.c
+++ b/camel/providers/pop3/camel-pop3-folder.c
@@ -702,7 +702,7 @@ pop3_folder_get_message_sync (CamelFolder *folder,
}
message = camel_mime_message_new ();
- if (!camel_data_wrapper_construct_from_stream_sync (
+ if (stream != NULL && !camel_data_wrapper_construct_from_stream_sync (
CAMEL_DATA_WRAPPER (message), stream, cancellable, error)) {
g_prefix_error (error, _("Cannot get message %s: "), uid);
g_object_unref (message);
@@ -712,7 +712,7 @@ pop3_folder_get_message_sync (CamelFolder *folder,
camel_medium_add_header (CAMEL_MEDIUM (message), "X-Evolution-POP3-UID", uid);
}
done:
- g_object_unref (stream);
+ g_clear_object (&stream);
fail:
g_clear_object (&pop3_cache);
g_clear_object (&pop3_engine);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]