soc.2008.masterpassword: 08ad64ae: Use g_new() where a struct is malloc'd.

qulogic at pidgin.im qulogic at pidgin.im
Mon Nov 7 02:36:54 EST 2011


----------------------------------------------------------------------
Revision: 08ad64ae65472ad7225de496ddbd45d9f14709c4
Parent:   0d66c09843eaecc984fa1d308702489ae83ef91a
Author:   qulogic at pidgin.im
Date:     11/01/11 00:58:05
Branch:   im.pidgin.soc.2008.masterpassword
URL: http://d.pidgin.im/viewmtn/revision/info/08ad64ae65472ad7225de496ddbd45d9f14709c4

Changelog: 

Use g_new() where a struct is malloc'd.

Changes against parent 0d66c09843eaecc984fa1d308702489ae83ef91a

  patched  libpurple/keyring.c
  patched  libpurple/plugins/keyrings/gnomekeyring.c

-------------- next part --------------
============================================================
--- libpurple/keyring.c	cb652010e7714f6774b43d507eda0dff443c11dc
+++ libpurple/keyring.c	8d31849801e216e4a42badd4ec3c0a7dc0322f1e
@@ -539,7 +539,7 @@ purple_keyring_set_inuse(const PurpleKey
 				close(NULL);  /* we can't do much about errors at this point */
 
 		} else {
-			tracker = g_malloc(sizeof(PurpleKeyringChangeTracker));
+			tracker = g_new(PurpleKeyringChangeTracker, 1);
 			oldkeyring = purple_keyring_get_inuse();
 
 			purple_keyring_inuse = newkeyring;
@@ -906,7 +906,7 @@ purple_keyring_set_password(PurpleAccoun
 			g_error_free(error);
 
 		} else {
-			cbinfo = g_malloc(sizeof(PurpleKeyringCbInfo));
+			cbinfo = g_new(PurpleKeyringCbInfo, 1);
 			cbinfo->cb = cb;
 			cbinfo->data = data;
 			save(account, password, purple_keyring_set_password_async_cb, data);
============================================================
--- libpurple/plugins/keyrings/gnomekeyring.c	51f8efed100c5bf6c485788b1e0b45fd7c424ee5
+++ libpurple/plugins/keyrings/gnomekeyring.c	6d32bc2cc15989a4ef6cfe98d76310ae816b91fc
@@ -132,7 +132,7 @@ gkp_read(PurpleAccount *account, PurpleK
 static void
 gkp_read(PurpleAccount *account, PurpleKeyringReadCallback cb, gpointer data)
 {
-	InfoStorage *storage = g_malloc(sizeof(InfoStorage));
+	InfoStorage *storage = g_new(InfoStorage, 1);
 
 	storage->cb = cb;
 	storage->user_data = data;


More information about the Commits mailing list