about summary refs log tree commit diff stats
path: root/src/xmpp
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2016-05-01 23:41:57 +0100
committerJames Booth <boothj5@gmail.com>2016-05-01 23:41:57 +0100
commit2bacd43a16d62911b6d475287f7c6df87f459fb7 (patch)
tree8ad8e6f4d0a888b312ca33cd1fca2bffe2843b08 /src/xmpp
parent6df6fed305c9c25caa1c4f7bed45cf1acd17edfc (diff)
downloadprofani-tty-2bacd43a16d62911b6d475287f7c6df87f459fb7.tar.gz
Free stanza text on plugin send hooks
Diffstat (limited to 'src/xmpp')
-rw-r--r--src/xmpp/iq.c1
-rw-r--r--src/xmpp/message.c1
-rw-r--r--src/xmpp/presence.c1
3 files changed, 3 insertions, 0 deletions
diff --git a/src/xmpp/iq.c b/src/xmpp/iq.c
index cba3d4d3..f3f221e9 100644
--- a/src/xmpp/iq.c
+++ b/src/xmpp/iq.c
@@ -2071,6 +2071,7 @@ send_iq_stanza(xmpp_stanza_t *const stanza)
     char *plugin_text = plugins_on_iq_stanza_send(text);
     if (plugin_text) {
         xmpp_send_raw_string(conn, "%s", plugin_text);
+        free(plugin_text);
     } else {
         xmpp_send_raw_string(conn, "%s", text);
     }
diff --git a/src/xmpp/message.c b/src/xmpp/message.c
index 71d51e19..9516217d 100644
--- a/src/xmpp/message.c
+++ b/src/xmpp/message.c
@@ -872,6 +872,7 @@ _send_message_stanza(xmpp_stanza_t *const stanza)
     char *plugin_text = plugins_on_message_stanza_send(text);
     if (plugin_text) {
         xmpp_send_raw_string(conn, "%s", plugin_text);
+        free(plugin_text);
     } else {
         xmpp_send_raw_string(conn, "%s", text);
     }
diff --git a/src/xmpp/presence.c b/src/xmpp/presence.c
index 6cc14552..c147970c 100644
--- a/src/xmpp/presence.c
+++ b/src/xmpp/presence.c
@@ -841,6 +841,7 @@ _send_presence_stanza(xmpp_stanza_t *const stanza)
     char *plugin_text = plugins_on_presence_stanza_send(text);
     if (plugin_text) {
         xmpp_send_raw_string(conn, "%s", plugin_text);
+        free(plugin_text);
     } else {
         xmpp_send_raw_string(conn, "%s", text);
     }