comparison mcabber/src/hooks.c @ 1108:a0e9eaa9f5b4

Fix small memory leak in hk_message_in()
author Mikael Berthe <mikael@lilotux.net>
date Thu, 14 Dec 2006 22:32:03 +0100
parents 1db3d045e95c
children 7e383aa48b3d
comparison
equal deleted inserted replaced
1107:1db3d045e95c 1108:a0e9eaa9f5b4
90 is_room = !!(buddy_gettype(roster_usr->data) & ROSTER_TYPE_ROOM); 90 is_room = !!(buddy_gettype(roster_usr->data) & ROSTER_TYPE_ROOM);
91 91
92 if (is_room) { 92 if (is_room) {
93 if (!is_groupchat) { 93 if (!is_groupchat) {
94 // This is a private message from a room participant 94 // This is a private message from a room participant
95 g_free(bmsg);
95 if (!resname) { 96 if (!resname) {
96 resname = ""; 97 resname = "";
97 wmsg = bmsg = g_strdup(msg); 98 wmsg = bmsg = g_strdup(msg);
98 } else { 99 } else {
99 wmsg = bmsg = g_strdup_printf("PRIV#<%s> %s", resname, msg); 100 wmsg = bmsg = g_strdup_printf("PRIV#<%s> %s", resname, msg);
100 if (!strncmp(msg, COMMAND_ME, strlen(COMMAND_ME))) 101 if (!strncmp(msg, COMMAND_ME, strlen(COMMAND_ME))) {
102 g_free(mmsg);
101 wmsg = mmsg = g_strdup_printf("PRIV#*%s %s", resname, msg+4); 103 wmsg = mmsg = g_strdup_printf("PRIV#*%s %s", resname, msg+4);
104 }
102 } 105 }
103 } else { 106 } else {
104 // This is a regular chatroom message. 107 // This is a regular chatroom message.
105 // Let's see if we are the message sender, in which case we'll 108 // Let's see if we are the message sender, in which case we'll
106 // highlight it. 109 // highlight it.