Mercurial > pidgin
comparison libpurple/protocols/silc/silc.c @ 25405:cfb3dee41d31
Plug a memory leak in SILC, thanks to Luke Petre.
Fixes #8273
committer: Ethan Blanton <elb@pidgin.im>
author | luke@petre.net |
---|---|
date | Sun, 01 Feb 2009 02:23:36 +0000 |
parents | 4a4f733c4bf1 |
children | b5c82724598c |
comparison
equal
deleted
inserted
replaced
25404:1cf4ead4119d | 25405:cfb3dee41d31 |
---|---|
1355 SilcPurpleIM im = context; | 1355 SilcPurpleIM im = context; |
1356 PurpleConversation *convo; | 1356 PurpleConversation *convo; |
1357 char tmp[256]; | 1357 char tmp[256]; |
1358 SilcClientEntry client_entry; | 1358 SilcClientEntry client_entry; |
1359 SilcDList list; | 1359 SilcDList list; |
1360 gboolean free_list = FALSE; | |
1360 | 1361 |
1361 convo = purple_find_conversation_with_account(PURPLE_CONV_TYPE_IM, im->nick, | 1362 convo = purple_find_conversation_with_account(PURPLE_CONV_TYPE_IM, im->nick, |
1362 sg->account); | 1363 sg->account); |
1363 if (!convo) | 1364 if (!convo) |
1364 return; | 1365 return; |
1371 so this will find the correct one. */ | 1372 so this will find the correct one. */ |
1372 clients = silc_client_get_clients_local(client, conn, | 1373 clients = silc_client_get_clients_local(client, conn, |
1373 im->nick, FALSE); | 1374 im->nick, FALSE); |
1374 if (!clients) | 1375 if (!clients) |
1375 goto err; | 1376 goto err; |
1377 | |
1378 free_list = TRUE; | |
1376 } | 1379 } |
1377 | 1380 |
1378 silc_dlist_start(clients); | 1381 silc_dlist_start(clients); |
1379 client_entry = silc_dlist_get(clients); | 1382 client_entry = silc_dlist_get(clients); |
1380 | 1383 |
1411 g_snprintf(tmp, sizeof(tmp), | 1414 g_snprintf(tmp, sizeof(tmp), |
1412 _("User <I>%s</I> is not present in the network"), im->nick); | 1415 _("User <I>%s</I> is not present in the network"), im->nick); |
1413 purple_conversation_write(convo, NULL, tmp, PURPLE_MESSAGE_SYSTEM, time(NULL)); | 1416 purple_conversation_write(convo, NULL, tmp, PURPLE_MESSAGE_SYSTEM, time(NULL)); |
1414 | 1417 |
1415 out: | 1418 out: |
1419 if (free_list) { | |
1420 silc_client_list_free(client, conn, clients); | |
1421 } | |
1416 g_free(im->nick); | 1422 g_free(im->nick); |
1417 g_free(im->message); | 1423 g_free(im->message); |
1418 silc_free(im); | 1424 silc_free(im); |
1419 } | 1425 } |
1420 | 1426 |