about summary refs log tree commit diff stats
path: root/src/otr/otr.c
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2015-08-20 22:02:58 +0100
committerJames Booth <boothj5@gmail.com>2015-08-20 22:02:58 +0100
commitc18b7f4d67a4b5e2cd026b47f9d51dae74427c1d (patch)
tree13f02a03c10d69f2eb65aee6e921c60f6c7d43fe /src/otr/otr.c
parent3000916ad9aed6b22025de17d5377695280dc8dd (diff)
downloadprofani-tty-c18b7f4d67a4b5e2cd026b47f9d51dae74427c1d.tar.gz
Free id for OTR messages
Diffstat (limited to 'src/otr/otr.c')
-rw-r--r--src/otr/otr.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/otr/otr.c b/src/otr/otr.c
index e61a0e47..a7790bcb 100644
--- a/src/otr/otr.c
+++ b/src/otr/otr.c
@@ -110,7 +110,8 @@ static void
 cb_inject_message(void *opdata, const char *accountname,
     const char *protocol, const char *recipient, const char *message)
 {
-    message_send_chat_otr(recipient, message);
+    char *id = message_send_chat_otr(recipient, message);
+    free(id);
 }
 
 static void
@@ -291,7 +292,8 @@ otr_on_message_recv(const char * const barejid, const char * const resource, con
                 memmove(whitespace_base, whitespace_base+tag_length, tag_length);
                 char *otr_query_message = otr_start_query();
                 cons_show("OTR Whitespace pattern detected. Attempting to start OTR session...");
-                message_send_chat_otr(barejid, otr_query_message);
+                char *id = message_send_chat_otr(barejid, otr_query_message);
+                free(id);
             }
         }
     }
@@ -304,7 +306,8 @@ otr_on_message_recv(const char * const barejid, const char * const resource, con
     if (policy == PROF_OTRPOLICY_ALWAYS && *was_decrypted == FALSE && !whitespace_base) {
         char *otr_query_message = otr_start_query();
         cons_show("Attempting to start OTR session...");
-        message_send_chat_otr(barejid, otr_query_message);
+        char *id = message_send_chat_otr(barejid, otr_query_message);
+        free(id);
     }
 
     return decrypted;