about summary refs log tree commit diff stats
path: root/src/xmpp/stanza.c
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2016-09-05 23:27:56 +0100
committerJames Booth <boothj5@gmail.com>2016-09-05 23:27:56 +0100
commit4647fd8a4fed432faf68de1b48d964deb01b7474 (patch)
treecac6ecadedfc8609d2c6863f17e41b9faccd4dc0 /src/xmpp/stanza.c
parent77ef4de29ec72cd26833fdb5e68d79d44cdaafe5 (diff)
downloadprofani-tty-4647fd8a4fed432faf68de1b48d964deb01b7474.tar.gz
Free stanzas on stanza_create_http_upload_request()
Diffstat (limited to 'src/xmpp/stanza.c')
-rw-r--r--src/xmpp/stanza.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/xmpp/stanza.c b/src/xmpp/stanza.c
index ed7d0fce..2c4f1bd0 100644
--- a/src/xmpp/stanza.c
+++ b/src/xmpp/stanza.c
@@ -244,6 +244,8 @@ stanza_create_http_upload_request(xmpp_ctx_t *ctx, const char *const id,
     free(filename_cpy);
     xmpp_stanza_add_child(filename, filename_txt);
     xmpp_stanza_add_child(request, filename);
+    xmpp_stanza_release(filename_txt);
+    xmpp_stanza_release(filename);
 
     xmpp_stanza_t *size = xmpp_stanza_new(ctx);
     xmpp_stanza_set_name(size, STANZA_NAME_SIZE);
@@ -255,6 +257,8 @@ stanza_create_http_upload_request(xmpp_ctx_t *ctx, const char *const id,
     }
     xmpp_stanza_add_child(size, size_txt);
     xmpp_stanza_add_child(request, size);
+    xmpp_stanza_release(size_txt);
+    xmpp_stanza_release(size);
 
     xmpp_stanza_t *content_type = xmpp_stanza_new(ctx);
     xmpp_stanza_set_name(content_type, STANZA_NAME_CONTENT_TYPE);
@@ -262,6 +266,8 @@ stanza_create_http_upload_request(xmpp_ctx_t *ctx, const char *const id,
     xmpp_stanza_set_text(content_type_txt, upload->mime_type);
     xmpp_stanza_add_child(content_type, content_type_txt);
     xmpp_stanza_add_child(request, content_type);
+    xmpp_stanza_release(content_type_txt);
+    xmpp_stanza_release(content_type);
 
     xmpp_stanza_add_child(iq, request);
     xmpp_stanza_release(request);