Moved stanza_free

This commit is contained in:
James Booth
2015-06-06 22:56:30 +01:00
parent c521962dd1
commit 98b06b717c
4 changed files with 25 additions and 25 deletions

View File

@@ -258,6 +258,30 @@ stanza_get_query_request(XMPPStanza *stanza)
return xmlns;
}
static void
_attrs_free(XMPPAttr *attr)
{
if (attr) {
free(attr->name);
free(attr->value);
free(attr);
}
}
void
stanza_free(XMPPStanza *stanza)
{
if (stanza) {
free(stanza->name);
if (stanza->content) {
g_string_free(stanza->content, TRUE);
}
g_list_free_full(stanza->attrs, (GDestroyNotify)_attrs_free);
g_list_free_full(stanza->children, (GDestroyNotify)stanza_free);
free(stanza);
}
}
static void
start_element(void *data, const char *element, const char **attributes)
{