Mercurial > pidgin
changeset 5125:74139d2562f5
[gaim-migrate @ 5488]
properly handle NULL settings, and hopefully fix a potential buddy icon
segfault. I'm sure KingAnt will come up with a better fix for this later
committer: Tailor Script <tailor@pidgin.im>
author | Nathan Walp <nwalp@pidgin.im> |
---|---|
date | Mon, 14 Apr 2003 00:53:44 +0000 |
parents | 2e78141ec1b5 |
children | 7208bf69929f |
files | src/list.c src/protocols/oscar/oscar.c |
diffstat | 2 files changed, 11 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/src/list.c Sun Apr 13 22:19:43 2003 +0000 +++ b/src/list.c Mon Apr 14 00:53:44 2003 +0000 @@ -1200,9 +1200,16 @@ static void blist_print_buddy_settings(gpointer key, gpointer data, gpointer user_data) { - char *key_val = g_markup_escape_text(key, -1); - char *data_val = g_markup_escape_text(data, -1); + char *key_val; + char *data_val; FILE *file = user_data; + + if(!key || !data) + return; + + key_val = g_markup_escape_text(key, -1); + data_val = g_markup_escape_text(data, -1); + fprintf(file, "\t\t\t\t\t<setting name=\"%s\">%s</setting>\n", key_val, data_val); g_free(key_val);
--- a/src/protocols/oscar/oscar.c Sun Apr 13 22:19:43 2003 +0000 +++ b/src/protocols/oscar/oscar.c Mon Apr 14 00:53:44 2003 +0000 @@ -3406,7 +3406,8 @@ b = gaim_find_buddy(gc->account, sn); gaim_buddy_set_setting(b, "icon_checksum", b16); gaim_blist_save(); - free(b16); + if(b16) + free(b16); } cur = od->requesticon;