Mercurial > ~mikael > mcabber > hg
comparison mcabber/src/jabglue.c @ 1546:c4ed9e145279
Fix uninitialized pointer (reported by T. Glaser)
author | Mikael Berthe <mikael@lilotux.net> |
---|---|
date | Sun, 05 Oct 2008 23:39:26 +0200 |
parents | 890a703197cf |
children | 3df441efb7c2 |
comparison
equal
deleted
inserted
replaced
1545:31472d421267 | 1546:c4ed9e145279 |
---|---|
2598 if (xmlnode_get_tag(xmldata, "subject")) { | 2598 if (xmlnode_get_tag(xmldata, "subject")) { |
2599 if (!type || strcmp(type, TMSG_GROUPCHAT)) { // Chat message | 2599 if (!type || strcmp(type, TMSG_GROUPCHAT)) { // Chat message |
2600 subject = p; | 2600 subject = p; |
2601 } else { // Room topic | 2601 } else { // Room topic |
2602 GSList *roombuddy; | 2602 GSList *roombuddy; |
2603 gchar *mbuf; | 2603 gchar *mbuf = NULL; |
2604 gchar *subj = p; | 2604 gchar *subj = p; |
2605 | 2605 |
2606 // In a groupchat message, the subject can be NULL when | 2606 // In a groupchat message, the subject can be NULL when |
2607 // the topic is cleared! | 2607 // the topic is cleared! |
2608 if (!p) | 2608 if (!p) |
2626 if (subj) | 2626 if (subj) |
2627 mbuf = g_strdup_printf("%s has set the topic to: %s", r, subj); | 2627 mbuf = g_strdup_printf("%s has set the topic to: %s", r, subj); |
2628 else | 2628 else |
2629 mbuf = g_strdup_printf("%s has cleared the topic", r); | 2629 mbuf = g_strdup_printf("%s has cleared the topic", r); |
2630 } | 2630 } |
2631 scr_WriteIncomingMessage(s, mbuf, 0, | 2631 if (mbuf) { |
2632 HBB_PREFIX_INFO|HBB_PREFIX_NOFLAG, 0); | 2632 scr_WriteIncomingMessage(s, mbuf, 0, |
2633 if (settings_opt_get_int("log_muc_conf")) | 2633 HBB_PREFIX_INFO|HBB_PREFIX_NOFLAG, 0); |
2634 hlog_write_message(s, 0, -1, mbuf); | 2634 if (settings_opt_get_int("log_muc_conf")) |
2635 hlog_write_message(s, 0, -1, mbuf); | |
2636 g_free(mbuf); | |
2637 } | |
2635 g_free(s); | 2638 g_free(s); |
2636 g_free(mbuf); | |
2637 // The topic is displayed in the chat status line, so refresh now. | 2639 // The topic is displayed in the chat status line, so refresh now. |
2638 scr_UpdateChatStatus(TRUE); | 2640 scr_UpdateChatStatus(TRUE); |
2639 } | 2641 } |
2640 } | 2642 } |
2641 | 2643 |