# HG changeset patch # User Mark Doliner # Date 1145318020 0 # Node ID b10030f6eab7a99385f10f7df8462741d511bd3a # Parent 3eba1e7458c727a79e01549be71a91232ebf2277 [gaim-migrate @ 16050] This should fix Coverity CID 49: buddy was sometimes leaking in _resolve_reply() in src/protocols/bonjour/dns_sd.c committer: Tailor Script diff -r 3eba1e7458c7 -r b10030f6eab7 src/protocols/bonjour/buddy.c --- a/src/protocols/bonjour/buddy.c Mon Apr 17 19:28:15 2006 +0000 +++ b/src/protocols/bonjour/buddy.c Mon Apr 17 23:53:40 2006 +0000 @@ -27,9 +27,10 @@ * Creates a new buddy. */ BonjourBuddy * -bonjour_buddy_new(gchar *name, gchar *first, gint port_p2pj, - gchar *phsh, gchar *status, gchar *email, gchar *last, gchar *jid, gchar *AIM, - gchar *vc, gchar *ip, gchar *msg) +bonjour_buddy_new(const gchar *name, const gchar *first, gint port_p2pj, + const gchar *phsh, const gchar *status, const gchar *email, + const gchar *last, const gchar *jid, const gchar *AIM, + const gchar *vc, const gchar *ip, const gchar *msg) { BonjourBuddy *buddy = malloc(sizeof(BonjourBuddy)); diff -r 3eba1e7458c7 -r b10030f6eab7 src/protocols/bonjour/buddy.h --- a/src/protocols/bonjour/buddy.h Mon Apr 17 19:28:15 2006 +0000 +++ b/src/protocols/bonjour/buddy.h Mon Apr 17 23:53:40 2006 +0000 @@ -43,9 +43,10 @@ /** * Creates a new buddy. */ -BonjourBuddy *bonjour_buddy_new(gchar *name, gchar *first, gint port_p2pj, - gchar *phsh, gchar *status, gchar *email, gchar *last, gchar *jid, gchar *AIM, - gchar *vc, gchar *ip, gchar *msg); +BonjourBuddy *bonjour_buddy_new(const gchar *name, const gchar *first, + gint port_p2pj, const gchar *phsh, const gchar *status, + const gchar *email, const gchar *last, const gchar *jid, + const gchar *AIM, const gchar *vc, const gchar *ip, const gchar *msg); /** * Check if all the compulsory buddy data is present. diff -r 3eba1e7458c7 -r b10030f6eab7 src/protocols/bonjour/dns_sd.c --- a/src/protocols/bonjour/dns_sd.c Mon Apr 17 19:28:15 2006 +0000 +++ b/src/protocols/bonjour/dns_sd.c Mon Apr 17 23:53:40 2006 +0000 @@ -143,11 +143,12 @@ /* Put the parameters of the text_record in a buddy and add the buddy to */ /* the buddy list */ - buddy = bonjour_buddy_new((gchar *)name, first, port_p2pj, phsh, + buddy = bonjour_buddy_new(name, first, port_p2pj, phsh, status, email, last, jid, AIM, vc, ip, msg); if (bonjour_buddy_check(buddy) == FALSE) { + bonjour_buddy_delete(buddy); return SW_DISCOVERY_E_UNKNOWN; }