/pidgin/main: 6d2ba273a5b2: Keyring: fix clang warnings

Tomasz Wasilczyk twasilczyk at pidgin.im
Fri Jan 10 14:55:17 EST 2014


Changeset: 6d2ba273a5b27de41195c1685e44e81f20637ff7
Author:	 Tomasz Wasilczyk <twasilczyk at pidgin.im>
Date:	 2014-01-10 20:55 +0100
Branch:	 default
URL: https://hg.pidgin.im/pidgin/main/rev/6d2ba273a5b2

Description:

Keyring: fix clang warnings

diffstat:

 libpurple/keyring.c                          |  6 ++++--
 libpurple/plugins/keyrings/internalkeyring.c |  1 +
 2 files changed, 5 insertions(+), 2 deletions(-)

diffs (34 lines):

diff --git a/libpurple/keyring.c b/libpurple/keyring.c
--- a/libpurple/keyring.c
+++ b/libpurple/keyring.c
@@ -267,7 +267,9 @@ purple_keyring_set_inuse_save_cb(PurpleA
 
 	tracker->read_outstanding--;
 
-	if (g_error_matches(error, PURPLE_KEYRING_ERROR,
+	if (error == NULL) {
+		/* no error */
+	} else if (g_error_matches(error, PURPLE_KEYRING_ERROR,
 		PURPLE_KEYRING_ERROR_NOPASSWORD)) {
 		if (purple_debug_is_verbose()) {
 			purple_debug_misc("keyring", "No password found while "
@@ -302,7 +304,7 @@ purple_keyring_set_inuse_save_cb(PurpleA
 		if (tracker->error != NULL)
 			g_error_free(tracker->error);
 		tracker->error = g_error_copy(error);
-	} else if (error != NULL) {
+	} else {
 		purple_debug_error("keyring", "Unknown error while changing "
 			"keyring for account %s: %s. Aborting changes.\n",
 			purple_keyring_print_account(account), error->message);
diff --git a/libpurple/plugins/keyrings/internalkeyring.c b/libpurple/plugins/keyrings/internalkeyring.c
--- a/libpurple/plugins/keyrings/internalkeyring.c
+++ b/libpurple/plugins/keyrings/internalkeyring.c
@@ -261,6 +261,7 @@ intkeyring_encrypt(intkeyring_buff_t *ke
 	plaintext_len += verify_len;
 
 	iv = intkeyring_gen_salt(purple_cipher_get_block_size(cipher));
+	g_return_val_if_fail(iv != NULL, NULL);
 	purple_cipher_set_iv(cipher, iv->data, iv->len);
 	purple_cipher_set_key(cipher, key->data, key->len);
 	purple_cipher_set_batch_mode(cipher,



More information about the Commits mailing list