1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-09-22 19:45:54 -04:00

Fixed various jid and account mem leaks

This commit is contained in:
James Booth 2015-06-24 20:53:04 +01:00
parent 626ab51ed4
commit 240f6a3f79
6 changed files with 10 additions and 1 deletions

View File

@ -226,6 +226,7 @@ cmd_connect(ProfWin *window, gchar **args, struct cmd_help_t help)
} else {
cons_show("Error evaluating password, see logs for details.");
g_free(lower);
account_free(account);
return TRUE;
}
@ -2179,6 +2180,7 @@ cmd_join(ProfWin *window, gchar **args, struct cmd_help_t help)
if (!parsed) {
cons_show("Usage: %s", help.usage);
cons_show("");
jid_destroy(room_arg);
return TRUE;
}

View File

@ -411,6 +411,8 @@ accounts_set_jid(const char * const account_name, const char * const value)
_save_accounts();
}
jid_destroy(jid);
}
}

View File

@ -192,4 +192,4 @@ jid_fulljid_or_barejid(Jid *jid)
} else {
return jid->barejid;
}
}
}

View File

@ -366,6 +366,7 @@ _jabber_connect(const char * const fulljid, const char * const passwd,
} else if (jid->fulljid == NULL) {
log_error("Full JID required to connect, received: %s", fulljid);
jabber_conn.conn_status = JABBER_DISCONNECTED;
jid_destroy(jid);
return jabber_conn.conn_status;
}

View File

@ -170,6 +170,7 @@ message_send_chat_pgp(const char * const barejid, const char * const msg)
} else {
message = stanza_create_message(ctx, id, jid, STANZA_TYPE_CHAT, msg);
}
jid_destroy(jidp);
} else {
message = stanza_create_message(ctx, id, jid, STANZA_TYPE_CHAT, msg);
}
@ -449,6 +450,7 @@ _conference_handler(xmpp_conn_t * const conn, xmpp_stanza_t * const stanza, void
// XEP-0249
char *room = xmpp_stanza_get_attribute(xns_conference, STANZA_ATTR_JID);
if (!room) {
jid_destroy(jidp);
return 1;
}
@ -754,6 +756,7 @@ _chat_handler(xmpp_conn_t * const conn, xmpp_stanza_t * const stanza, void * con
// private message from chat room use full jid (room/nick)
if (muc_active(jid->barejid)) {
_private_chat_handler(stanza, jid->fulljid);
jid_destroy(jid);
return 1;
}

View File

@ -670,6 +670,7 @@ _muc_user_handler(xmpp_conn_t * const conn, xmpp_stanza_t * const stanza, void *
// invalid from attribute
Jid *from_jid = jid_create(from);
if (from_jid == NULL || from_jid->resourcepart == NULL) {
jid_destroy(from_jid);
return 1;
}