}
if (strcmp(opt->longName, "hostname") == 0) {
- g_free(opt_hostname);
- opt_hostname = g_strdup(arg);
+ silc_free(opt_hostname);
+ opt_hostname = strdup(arg);
}
if (strcmp(opt->longName, "list-ciphers") == 0) {
SILC_LOG_DEBUG(("Client library has stopped"));
if (idletag != -1)
g_source_remove(idletag);
+ signal_emit("chat protocol deinit", 1,
+ chat_protocol_find("SILC"));
}
static void sig_gui_quit(SILC_SERVER_REC *server, const char *msg)
}
/* Initialize the SILC client */
+ opt_hostname = (opt_hostname ? opt_hostname : silc_net_localhost());
if (!silc_client_init(silc_client, settings_get_str("user_name"),
- opt_hostname ? opt_hostname : silc_net_localhost(),
- settings_get_str("real_name"), silc_running, NULL)) {
+ opt_hostname, settings_get_str("real_name"),
+ silc_running, NULL)) {
sleep(1);
exit(1);
return;
if (idletag != -1)
g_source_remove(idletag);
- signal_emit("chat protocol deinit", 1,
- chat_protocol_find("SILC"));
+ if (opt_hostname)
+ silc_free(opt_hostname);
+ if (opt_nickname)
+ g_free(opt_nickname);
+
signal_remove("setup changed", (SIGNAL_FUNC) sig_setup_changed);
signal_remove("irssi init finished", (SIGNAL_FUNC) sig_init_finished);
signal_remove("gui exit", (SIGNAL_FUNC) sig_gui_quit);
+ silc_hash_free(sha1hash);
+
silc_queue_deinit();
silc_server_deinit();
silc_channels_deinit();
chat_protocol_unregister("SILC");
- silc_pkcs_private_key_free(irssi_privkey);
silc_pkcs_public_key_free(irssi_pubkey);
+ silc_pkcs_private_key_free(irssi_privkey);
silc_client_free(silc_client);
}