1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-12-04 14:46:46 -05:00

Free software version result properties

This commit is contained in:
James Booth 2015-08-09 01:10:02 +01:00
parent 3b79d5aa63
commit 131f1788c2

View File

@ -892,6 +892,8 @@ _version_result_handler(xmpp_conn_t * const conn, xmpp_stanza_t * const stanza,
log_warning("From attribute specified different JID, using original JID."); log_warning("From attribute specified different JID, using original JID.");
} }
xmpp_ctx_t *ctx = xmpp_conn_get_context(conn);
Jid *jidp = jid_create((char*)userdata); Jid *jidp = jid_create((char*)userdata);
const char *presence = NULL; const char *presence = NULL;
if (muc_active(jidp->barejid)) { if (muc_active(jidp->barejid)) {
@ -902,6 +904,9 @@ _version_result_handler(xmpp_conn_t * const conn, xmpp_stanza_t * const stanza,
Resource *resource = p_contact_get_resource(contact, jidp->resourcepart); Resource *resource = p_contact_get_resource(contact, jidp->resourcepart);
if (!resource) { if (!resource) {
ui_handle_software_version_error(jidp->fulljid, "Unknown resource"); ui_handle_software_version_error(jidp->fulljid, "Unknown resource");
if (name_str) xmpp_free(ctx, name_str);
if (version_str) xmpp_free(ctx, version_str);
if (os_str) xmpp_free(ctx, os_str);
return 0; return 0;
} }
presence = string_from_resource_presence(resource->presence); presence = string_from_resource_presence(resource->presence);
@ -912,6 +917,10 @@ _version_result_handler(xmpp_conn_t * const conn, xmpp_stanza_t * const stanza,
jid_destroy(jidp); jid_destroy(jidp);
free(userdata); free(userdata);
if (name_str) xmpp_free(ctx, name_str);
if (version_str) xmpp_free(ctx, version_str);
if (os_str) xmpp_free(ctx, os_str);
return 0; return 0;
} }