Mercurial > ~mikael > mcabber > hg
comparison mcabber/src/commands.c @ 774:46304b773a44
Remove useless checks before g_free() calls
author | Mikael Berthe <mikael@lilotux.net> |
---|---|
date | Sat, 25 Mar 2006 18:16:10 +0100 |
parents | 464be13343a9 |
children | e6d42f239541 |
comparison
equal
deleted
inserted
replaced
773:e25b8a348ebd | 774:46304b773a44 |
---|---|
1465 | 1465 |
1466 roomname = buddy_getjid(bud); | 1466 roomname = buddy_getjid(bud); |
1467 reason_utf8 = to_utf8(arg); | 1467 reason_utf8 = to_utf8(arg); |
1468 jb_room_invite(roomname, jid, reason_utf8); | 1468 jb_room_invite(roomname, jid, reason_utf8); |
1469 scr_LogPrint(LPRINT_LOGNORM, "Invitation sent to <%s>...", jid); | 1469 scr_LogPrint(LPRINT_LOGNORM, "Invitation sent to <%s>...", jid); |
1470 if (reason_utf8) g_free(reason_utf8); | 1470 g_free(reason_utf8); |
1471 free_arg_lst(paramlst); | 1471 free_arg_lst(paramlst); |
1472 } | 1472 } |
1473 | 1473 |
1474 static void room_affil(gpointer bud, char *arg) | 1474 static void room_affil(gpointer bud, char *arg) |
1475 { | 1475 { |
1498 if (ra.val.affil < imaffiliation_size) { | 1498 if (ra.val.affil < imaffiliation_size) { |
1499 gchar *jid_utf8, *reason_utf8; | 1499 gchar *jid_utf8, *reason_utf8; |
1500 jid_utf8 = to_utf8(jid); | 1500 jid_utf8 = to_utf8(jid); |
1501 reason_utf8 = to_utf8(arg); | 1501 reason_utf8 = to_utf8(arg); |
1502 jb_room_setattrib(roomid, jid_utf8, NULL, ra, reason_utf8); | 1502 jb_room_setattrib(roomid, jid_utf8, NULL, ra, reason_utf8); |
1503 if (jid_utf8) g_free(jid_utf8); | 1503 g_free(jid_utf8); |
1504 if (reason_utf8) g_free(reason_utf8); | 1504 g_free(reason_utf8); |
1505 } else | 1505 } else |
1506 scr_LogPrint(LPRINT_NORMAL, "Wrong affiliation parameter."); | 1506 scr_LogPrint(LPRINT_NORMAL, "Wrong affiliation parameter."); |
1507 | 1507 |
1508 free_arg_lst(paramlst); | 1508 free_arg_lst(paramlst); |
1509 } | 1509 } |
1535 if (ra.val.role < imrole_size) { | 1535 if (ra.val.role < imrole_size) { |
1536 gchar *jid_utf8, *reason_utf8; | 1536 gchar *jid_utf8, *reason_utf8; |
1537 jid_utf8 = to_utf8(jid); | 1537 jid_utf8 = to_utf8(jid); |
1538 reason_utf8 = to_utf8(arg); | 1538 reason_utf8 = to_utf8(arg); |
1539 jb_room_setattrib(roomid, jid_utf8, NULL, ra, reason_utf8); | 1539 jb_room_setattrib(roomid, jid_utf8, NULL, ra, reason_utf8); |
1540 if (jid_utf8) g_free(jid_utf8); | 1540 g_free(jid_utf8); |
1541 if (reason_utf8) g_free(reason_utf8); | 1541 g_free(reason_utf8); |
1542 } else | 1542 } else |
1543 scr_LogPrint(LPRINT_NORMAL, "Wrong role parameter."); | 1543 scr_LogPrint(LPRINT_NORMAL, "Wrong role parameter."); |
1544 | 1544 |
1545 free_arg_lst(paramlst); | 1545 free_arg_lst(paramlst); |
1546 } | 1546 } |
1569 ra.val.affil = affil_outcast; | 1569 ra.val.affil = affil_outcast; |
1570 | 1570 |
1571 jid_utf8 = to_utf8(jid); | 1571 jid_utf8 = to_utf8(jid); |
1572 reason_utf8 = to_utf8(arg); | 1572 reason_utf8 = to_utf8(arg); |
1573 jb_room_setattrib(roomid, jid_utf8, NULL, ra, reason_utf8); | 1573 jb_room_setattrib(roomid, jid_utf8, NULL, ra, reason_utf8); |
1574 if (jid_utf8) g_free(jid_utf8); | 1574 g_free(jid_utf8); |
1575 if (reason_utf8) g_free(reason_utf8); | 1575 g_free(reason_utf8); |
1576 | 1576 |
1577 free_arg_lst(paramlst); | 1577 free_arg_lst(paramlst); |
1578 } | 1578 } |
1579 | 1579 |
1580 // The expected argument is a nickname | 1580 // The expected argument is a nickname |
1600 ra.val.affil = role_none; | 1600 ra.val.affil = role_none; |
1601 | 1601 |
1602 nick_utf8 = to_utf8(nick); | 1602 nick_utf8 = to_utf8(nick); |
1603 reason_utf8 = to_utf8(arg); | 1603 reason_utf8 = to_utf8(arg); |
1604 jb_room_setattrib(roomid, NULL, nick_utf8, ra, reason_utf8); | 1604 jb_room_setattrib(roomid, NULL, nick_utf8, ra, reason_utf8); |
1605 if (nick_utf8) g_free(nick_utf8); | 1605 g_free(nick_utf8); |
1606 if (reason_utf8) g_free(reason_utf8); | 1606 g_free(reason_utf8); |
1607 | 1607 |
1608 free_arg_lst(paramlst); | 1608 free_arg_lst(paramlst); |
1609 } | 1609 } |
1610 | 1610 |
1611 static void room_leave(gpointer bud, char *arg) | 1611 static void room_leave(gpointer bud, char *arg) |
1724 msg = to_utf8(arg); | 1724 msg = to_utf8(arg); |
1725 else | 1725 else |
1726 msg = NULL; | 1726 msg = NULL; |
1727 | 1727 |
1728 jb_room_destroy(buddy_getjid(bud), NULL, msg); | 1728 jb_room_destroy(buddy_getjid(bud), NULL, msg); |
1729 if (msg) g_free(msg); | 1729 g_free(msg); |
1730 } | 1730 } |
1731 | 1731 |
1732 static void room_unlock(gpointer bud, char *arg) | 1732 static void room_unlock(gpointer bud, char *arg) |
1733 { | 1733 { |
1734 if (*arg) { | 1734 if (*arg) { |