# HG changeset patch # User Daniel Atallah # Date 1131633567 0 # Node ID 52eaf0f0db4c8dcb1178825781056bde99530038 # Parent bad5f83e7f224cbd2aba6addce82ef43f8a4406c [gaim-migrate @ 14328] data->session actually is being allocated 3 times - once in bonjour_dns_sd_new(), once in bonjour_dns_sd_start(), and once in sw_discovery_init() inside howl. This removes the first two unnecesssary allocations (which will leak). committer: Tailor Script diff -r bad5f83e7f22 -r 52eaf0f0db4c src/protocols/bonjour/dns_sd.c --- a/src/protocols/bonjour/dns_sd.c Thu Nov 10 14:30:28 2005 +0000 +++ b/src/protocols/bonjour/dns_sd.c Thu Nov 10 14:39:27 2005 +0000 @@ -295,8 +295,7 @@ BonjourDnsSd * bonjour_dns_sd_new() { - BonjourDnsSd *data = g_new(BonjourDnsSd, 1); - data->session = g_malloc(sizeof(sw_discovery)); + BonjourDnsSd *data = g_new0(BonjourDnsSd, 1); return data; } @@ -307,7 +306,6 @@ void bonjour_dns_sd_free(BonjourDnsSd *data) { - g_free(data->session); g_free(data->first); g_free(data->last); g_free(data->email); @@ -346,10 +344,8 @@ gc = gaim_account_get_connection(account); /* Initialize the dns-sd data and session */ - data->session = malloc(sizeof(sw_discovery)); if (sw_discovery_init(data->session) != SW_OKAY) { - free(data->session); data->session = NULL; gaim_debug_error("bonjour", "Unable to initialize an mDNS session.\n"); return FALSE;