fixed memory leaks in various files

This commit is contained in:
Dmitry Podgorny
2013-08-25 14:54:34 +03:00
parent c7ec06ff65
commit b1bfdf650a
5 changed files with 60 additions and 29 deletions

View File

@@ -280,13 +280,14 @@ caps_create_query_response_stanza(xmpp_ctx_t * const ctx)
xmpp_stanza_add_child(query, feature_version);
xmpp_stanza_add_child(query, feature_ping);
xmpp_stanza_release(identity);
xmpp_stanza_release(feature_muc);
xmpp_stanza_release(feature_discoinfo);
xmpp_stanza_release(feature_discoitems);
xmpp_stanza_release(feature_caps);
xmpp_stanza_release(feature_ping);
xmpp_stanza_release(feature_version);
xmpp_stanza_release(feature_muc);
xmpp_stanza_release(feature_discoitems);
xmpp_stanza_release(feature_discoinfo);
xmpp_stanza_release(feature_chatstates);
xmpp_stanza_release(feature_caps);
xmpp_stanza_release(identity);
return query;
}

View File

@@ -247,6 +247,12 @@ _iq_handle_version_get(xmpp_conn_t * const conn, xmpp_stanza_t * const stanza,
xmpp_send(conn, response);
g_free(version_str);
xmpp_stanza_release(name_txt);
xmpp_stanza_release(version_txt);
xmpp_stanza_release(name);
xmpp_stanza_release(version);
xmpp_stanza_release(query);
xmpp_stanza_release(response);
}
@@ -437,9 +443,6 @@ _iq_handle_discoinfo_result(xmpp_conn_t * const conn, xmpp_stanza_t * const stan
log_debug("Client info not cached");
DataForm *form = NULL;
FormField *formField = NULL;
const char *category = NULL;
const char *type = NULL;
const char *name = NULL;
@@ -458,7 +461,8 @@ _iq_handle_discoinfo_result(xmpp_conn_t * const conn, xmpp_stanza_t * const stan
xmpp_stanza_t *softwareinfo = xmpp_stanza_get_child_by_ns(query, STANZA_NS_DATA);
if (softwareinfo != NULL) {
form = stanza_create_form(softwareinfo);
DataForm *form = stanza_create_form(softwareinfo);
FormField *formField = NULL;
if (g_strcmp0(form->form_type, STANZA_DATAFORM_SOFTWARE) == 0) {
GSList *field = form->fields;
@@ -478,6 +482,8 @@ _iq_handle_discoinfo_result(xmpp_conn_t * const conn, xmpp_stanza_t * const stan
field = g_slist_next(field);
}
}
stanza_destroy_form(form);
}
xmpp_stanza_t *child = xmpp_stanza_get_children(query);
@@ -492,7 +498,6 @@ _iq_handle_discoinfo_result(xmpp_conn_t * const conn, xmpp_stanza_t * const stan
caps_add(caps_key, category, type, name, software, software_version,
os, os_version, features);
//stanza_destroy_form(form);
free(caps_key);
}

View File

@@ -280,6 +280,7 @@ _groupchat_message_handler(xmpp_conn_t * const conn,
message = xmpp_stanza_get_text(subject);
if (message != NULL) {
prof_handle_room_subject(jid->barejid, message);
xmpp_free(ctx, message);
}
jid_destroy(jid);

View File

@@ -502,6 +502,7 @@ _available_handler(xmpp_conn_t * const conn,
last_activity);
}
free(caps_key);
free(status_str);
free(show_str);
jid_destroy(my_jid);