mirror of
https://git.jabber.space/devs/cproof.git
synced 2026-07-25 20:56:21 +00:00
refactor: Use p_contact_new instead of malloc in p_contact_new()
This commit is contained in:
@@ -66,7 +66,7 @@ p_contact_new(const char* const barejid, const char* const name,
|
|||||||
GSList* groups, const char* const subscription,
|
GSList* groups, const char* const subscription,
|
||||||
const char* const offline_message, gboolean pending_out)
|
const char* const offline_message, gboolean pending_out)
|
||||||
{
|
{
|
||||||
PContact contact = malloc(sizeof(struct p_contact_t));
|
PContact contact = g_new0(struct p_contact_t, 1);
|
||||||
contact->barejid = strdup(barejid);
|
contact->barejid = strdup(barejid);
|
||||||
contact->barejid_collate_key = g_utf8_collate_key(contact->barejid, -1);
|
contact->barejid_collate_key = g_utf8_collate_key(contact->barejid, -1);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user