diff options
author | Milan Crha <mcrha@redhat.com> | 2013-11-15 16:06:57 +0800 |
---|---|---|
committer | Milan Crha <mcrha@redhat.com> | 2013-11-15 16:06:57 +0800 |
commit | 570c6374806d0f1ec59cf7a72543efe6b5b637be (patch) | |
tree | c5390b1fcb73f30c28bf37168add9bf1dc622b42 /mail/em-utils.c | |
parent | 1be51f232560f864ba8795a38e55d472b5b0e2b3 (diff) | |
download | gsoc2013-evolution-570c6374806d0f1ec59cf7a72543efe6b5b637be.tar gsoc2013-evolution-570c6374806d0f1ec59cf7a72543efe6b5b637be.tar.gz gsoc2013-evolution-570c6374806d0f1ec59cf7a72543efe6b5b637be.tar.bz2 gsoc2013-evolution-570c6374806d0f1ec59cf7a72543efe6b5b637be.tar.lz gsoc2013-evolution-570c6374806d0f1ec59cf7a72543efe6b5b637be.tar.xz gsoc2013-evolution-570c6374806d0f1ec59cf7a72543efe6b5b637be.tar.zst gsoc2013-evolution-570c6374806d0f1ec59cf7a72543efe6b5b637be.zip |
Fix/mute issues found by Coverity scan
This makes the code free of Coverity scan issues.
It is sometimes quite pedantic and expects/suggests some
coding habits, thus certain changes may look weird, but for a good
thing, I hope. The code is also tagged with Coverity scan
suppressions, to keep the code as is and hide the warning too.
Also note that Coverity treats g_return_if_fail(), g_assert() and
similar macros as unreliable, and it's true these can be disabled
during the compile time, thus it brings in other set of 'weird'
changes.
Diffstat (limited to 'mail/em-utils.c')
-rw-r--r-- | mail/em-utils.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/mail/em-utils.c b/mail/em-utils.c index db68b96003..6669ef5aff 100644 --- a/mail/em-utils.c +++ b/mail/em-utils.c @@ -590,7 +590,6 @@ em_utils_read_messages_from_stream (CamelFolder *folder, while (camel_mime_parser_step (mp, NULL, NULL) == CAMEL_MIME_PARSER_STATE_FROM) { CamelMimeMessage *msg; - gboolean success; /* NB: de-from filter, once written */ msg = camel_mime_message_new (); @@ -1060,6 +1059,8 @@ em_utils_selection_set_urilist (GtkSelectionData *data, exit: g_free (tmpdir); + /* the 'fd' from the 'save_as_mbox' part is freed within the 'fstream' */ + /* coverity[leaked_handle] */ } /** @@ -1094,6 +1095,8 @@ em_utils_selection_get_urilist (GtkSelectionData *selection_data, if (url == NULL) continue; + /* 'fd', if set, is freed within the 'stream' */ + /* coverity[overwrite_var] */ if (strcmp (url->protocol, "file") == 0 && (fd = g_open (url->path, O_RDONLY | O_BINARY, 0)) != -1) { stream = camel_stream_fs_new_with_fd (fd); @@ -1107,6 +1110,9 @@ em_utils_selection_get_urilist (GtkSelectionData *selection_data, } g_strfreev (uris); + + /* 'fd', if set, is freed within the 'stream' */ + /* coverity[leaked_handle] */ } /* ********************************************************************** */ |