about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorDmitry Podgorny <pasis.ua@gmail.com>2013-01-12 23:32:32 +0200
committerDmitry Podgorny <pasis.ua@gmail.com>2013-01-12 23:32:32 +0200
commit9121cbe29578539f489db3b1642aa366b2cfca14 (patch)
tree9bbafa72989087b94fe153f219ca3887f442e3f1 /src
parentdb9c9ab091c40bf2249010816cd0831520afc2e0 (diff)
downloadprofani-tty-9121cbe29578539f489db3b1642aa366b2cfca14.tar.gz
fixed memory leak in jabber_subscription()
Diffstat (limited to 'src')
-rw-r--r--src/jabber.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/jabber.c b/src/jabber.c
index a3db7d85..7709c405 100644
--- a/src/jabber.c
+++ b/src/jabber.c
@@ -295,8 +295,10 @@ jabber_subscription(const char * const jid, jabber_subscr_t action)
         type = STANZA_TYPE_SUBSCRIBED;
     else if (action == PRESENCE_UNSUBSCRIBED)
         type = STANZA_TYPE_UNSUBSCRIBED;
-    else // unknown action
+    else { // unknown action
+        free(jid_cpy);
         return;
+    }
 
     presence = xmpp_stanza_new(jabber_conn.ctx);
     xmpp_stanza_set_name(presence, STANZA_NAME_PRESENCE);