comparison libpurple/protocols/silc/buddy.c @ 22800:67a4c8c46f78

Cleanup allocations/frees to match and plug some leaks.
author Daniel Atallah <daniel.atallah@gmail.com>
date Sat, 03 May 2008 07:13:58 +0000
parents 665e04562de0
children d74ff4f23171
comparison
equal deleted inserted replaced
22799:fc1e708ddf92 22800:67a4c8c46f78
50 if (!clients) { 50 if (!clients) {
51 g_snprintf(tmp, sizeof(tmp), 51 g_snprintf(tmp, sizeof(tmp),
52 _("User %s is not present in the network"), r->nick); 52 _("User %s is not present in the network"), r->nick);
53 purple_notify_error(gc, _("Key Agreement"), 53 purple_notify_error(gc, _("Key Agreement"),
54 _("Cannot perform the key agreement"), tmp); 54 _("Cannot perform the key agreement"), tmp);
55 silc_free(r->nick); 55 g_free(r->nick);
56 silc_free(r); 56 silc_free(r);
57 return; 57 return;
58 } 58 }
59 59
60 silcpurple_buddy_keyagr_do(gc, r->nick, FALSE); 60 silcpurple_buddy_keyagr_do(gc, r->nick, FALSE);
61 silc_free(r->nick); 61 g_free(r->nick);
62 silc_free(r); 62 silc_free(r);
63 } 63 }
64 64
65 static void 65 static void
66 silcpurple_buddy_keyagr_cb(SilcClient client, 66 silcpurple_buddy_keyagr_cb(SilcClient client,
274 silcpurple_buddy_keyagr_do(a->client->application, 274 silcpurple_buddy_keyagr_do(a->client->application,
275 client_entry->nickname, TRUE); 275 client_entry->nickname, TRUE);
276 } 276 }
277 277
278 out: 278 out:
279 silc_free(a->hostname); 279 g_free(a->hostname);
280 silc_free(a); 280 silc_free(a);
281 } 281 }
282 282
283 void silcpurple_buddy_keyagr_request(SilcClient client, 283 void silcpurple_buddy_keyagr_request(SilcClient client,
284 SilcClientConnection conn, 284 SilcClientConnection conn,
307 return; 307 return;
308 a->client = client; 308 a->client = client;
309 a->conn = conn; 309 a->conn = conn;
310 a->client_id = client_entry->id; 310 a->client_id = client_entry->id;
311 if (hostname) 311 if (hostname)
312 a->hostname = strdup(hostname); 312 a->hostname = g_strdup(hostname);
313 a->port = port; 313 a->port = port;
314 314
315 purple_request_action(client->application, _("Key Agreement Request"), tmp, 315 purple_request_action(client->application, _("Key Agreement Request"), tmp,
316 hostname ? tmp2 : NULL, 1, gc->account, client_entry->nickname, 316 hostname ? tmp2 : NULL, 1, gc->account, client_entry->nickname,
317 NULL, a, 2, _("Yes"), G_CALLBACK(silcpurple_buddy_keyagr_request_cb), 317 NULL, a, 2, _("Yes"), G_CALLBACK(silcpurple_buddy_keyagr_request_cb),
414 g_free(context); 414 g_free(context);
415 return; 415 return;
416 } 416 }
417 417
418 silcpurple_buddy_privkey(client->application, context); 418 silcpurple_buddy_privkey(client->application, context);
419 silc_free(context); 419 g_free(context);
420 } 420 }
421 421
422 static void 422 static void
423 silcpurple_buddy_privkey(PurpleConnection *gc, const char *name) 423 silcpurple_buddy_privkey(PurpleConnection *gc, const char *name)
424 { 424 {
542 g_free(context); 542 g_free(context);
543 return; 543 return;
544 } 544 }
545 545
546 silcpurple_buddy_getkey(client->application, context); 546 silcpurple_buddy_getkey(client->application, context);
547 silc_free(context); 547 g_free(context);
548 } 548 }
549 549
550 static void 550 static void
551 silcpurple_buddy_getkey(PurpleConnection *gc, const char *name) 551 silcpurple_buddy_getkey(PurpleConnection *gc, const char *name)
552 { 552 {