/pidgin/main: 175e769076e1: Fix newly generated coverity warnings

Tomasz Wasilczyk <[email protected]>
Newsgroups gmane.comp.gnome.gaim.cvs
Message-ID <[email protected]>
Changeset: 175e769076e1a464ff7a54aa541bad4ee4c68665
Author:	 Tomasz Wasilczyk <[email protected]>
Date:	 2014-05-12 22:08 +0200
Branch:	 release-2.x.y
URL: https://hg.pidgin.im/pidgin/main/rev/175e769076e1

Description:

Fix newly generated coverity warnings

diffstat:

 libpurple/log.c                 |   1 +
 libpurple/protocols/silc/util.c |  10 ++++------
 pidgin/plugins/spellchk.c       |   2 +-
 3 files changed, 6 insertions(+), 7 deletions(-)

diffs (43 lines):

diff --git a/libpurple/log.c b/libpurple/log.c
--- a/libpurple/log.c
+++ b/libpurple/log.c
@@ -1716,6 +1716,7 @@ static GList *old_logger_list(PurpleLogT
 		if (st.st_mtime < log_last_modified)
 		{
 			purple_debug_warning("log", "Index \"%s\" exists, but is older than the log.\n", pathstr);
+			close(index_fd);
 		}
 		else
 		{
diff --git a/libpurple/protocols/silc/util.c b/libpurple/protocols/silc/util.c
--- a/libpurple/protocols/silc/util.c
+++ b/libpurple/protocols/silc/util.c
@@ -268,12 +268,10 @@ gboolean silcpurple_check_silc_dir(Purpl
 					close(fd);
 					return FALSE;
 				}
-			}
-			/* This shouldn't really happen because silc_create_key_pair()
-			 * will set the permissions */
-			else if ((fstat(fd, &st)) == -1) {
-				purple_debug_error("silc", "Couldn't stat '%s' private key, error: %s\n",
-						   file_private_key, g_strerror(errno));
+			} else {
+				purple_debug_error("silc", "Couldn't open '%s' "
+					"private key, error: %s\n",
+					file_private_key, g_strerror(errno));
 				return FALSE;
 			}
 		} else {
diff --git a/pidgin/plugins/spellchk.c b/pidgin/plugins/spellchk.c
--- a/pidgin/plugins/spellchk.c
+++ b/pidgin/plugins/spellchk.c
@@ -1790,7 +1790,7 @@ static void load_conf(void)
 	model = gtk_list_store_new((gint)N_COLUMNS, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_BOOLEAN, G_TYPE_BOOLEAN);
 	hashes = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, NULL);
 
-	while (buf_get_line(ibuf, &buf, &pnt, size)) {
+	while (ibuf && buf_get_line(ibuf, &buf, &pnt, size)) {
 		if (*buf != '#') {
 			if (!g_ascii_strncasecmp(buf, "BAD ", 4))
 			{
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.