# HG changeset patch # User Stu Tomlinson # Date 1208962440 0 # Node ID 757a571ae9bedacbe0b7e01722feb37efefdd1a8 # Parent 32624648b79751eb6f4fbcbc28f8ca63c7279116 Don't access uninitialized memory (I think this might actually fix some silc connection oddness I've been seeing too), and a leak fix or two. diff -r 32624648b797 -r 757a571ae9be libpurple/protocols/silc/silc.c --- a/libpurple/protocols/silc/silc.c Wed Apr 23 10:25:53 2008 +0000 +++ b/libpurple/protocols/silc/silc.c Wed Apr 23 14:54:00 2008 +0000 @@ -380,14 +380,6 @@ client = sg->client; - /* Progress */ - if (params.detach_data) { - purple_connection_update_progress(gc, _("Resuming session"), 2, 5); - sg->resuming = TRUE; - } else { - purple_connection_update_progress(gc, _("Performing key exchange"), 2, 5); - } - /* Get session detachment data, if available */ memset(¶ms, 0, sizeof(params)); dfile = silcpurple_session_file(purple_account_get_username(sg->account)); @@ -397,6 +389,14 @@ params.ignore_requested_attributes = FALSE; params.pfs = purple_account_get_bool(sg->account, "pfs", FALSE); + /* Progress */ + if (params.detach_data) { + purple_connection_update_progress(gc, _("Resuming session"), 2, 5); + sg->resuming = TRUE; + } else { + purple_connection_update_progress(gc, _("Performing key exchange"), 2, 5); + } + /* Perform SILC Key Exchange. */ silc_client_key_exchange(sg->client, ¶ms, sg->public_key, sg->private_key, stream, SILC_CONN_SERVER, @@ -550,8 +550,12 @@ _("Cannot initialize SILC protocol")); gc->proto_data = NULL; silc_free(sg); + free(hostname); + free(username); return; } + free(hostname); + free(username); /* Check the ~/.silc dir and create it, and new key pair if necessary. */ if (!silcpurple_check_silc_dir(gc)) {