} mw;
gint clients = 0;
+struct Client **client_arr;
+
int cooperative_pipe_fp = 0;
gchar *search_text;
set_uri(uri, c);
clients++;
+ client_arr = realloc(client_arr, (clients + 1) * sizeof(client_arr[0]));
+ client_arr[clients] = c;
+
return WEBKIT_WEB_VIEW(c->web_view);
}
gboolean mute = webkit_web_view_get_is_muted(WEBKIT_WEB_VIEW(c->web_view));
gchar *muted = (mute) ? "[m] " : "";
sprintf(name, "%s%s", muted, t);
-
gtk_label_set_text(GTK_LABEL(c->tablabel), name);
g_free(name);
+
gtk_widget_set_tooltip_text(c->tablabel, t);
mainwindow_title(gtk_notebook_get_current_page(GTK_NOTEBOOK(mw.notebook)));
}
WebKitCookiePersistentStorage type =
WEBKIT_COOKIE_PERSISTENT_STORAGE_SQLITE;
webkit_cookie_manager_set_persistent_storage(cm, fname, type);
+ g_free(fname);
}
const gchar *const languages[2] = {(const gchar *)cfg.spellcheck_language,
gchar *title = malloc(strlen(priv) + strlen(__NAME__) + 1);
sprintf(title, "%s%s", __NAME__, priv);
gtk_window_set_title(GTK_WINDOW(mw.win), title);
+ g_free(title);
mw.notebook = gtk_notebook_new();
gtk_notebook_set_scrollable(GTK_NOTEBOOK(mw.notebook), TRUE);
void
trust_user_certs(WebKitWebContext *wc) {
GTlsCertificate *cert;
- const gchar *basedir, *file, *absfile;
+ gchar *basedir, *absfile;
+ const gchar *file;
GDir *dir;
basedir = g_build_filename(g_get_user_data_dir(), __NAME__, "certs", NULL);
dir = g_dir_open(basedir, 0, NULL);
+ g_free(basedir);
if (dir != NULL) {
file = g_dir_read_name(dir);
while (file != NULL) {
absfile = g_build_filename(g_get_user_data_dir(), __NAME__, "certs",
file, NULL);
cert = g_tls_certificate_new_from_file(absfile, NULL);
+ g_free(absfile);
if (cert == NULL)
fprintf(stderr, __NAME__ ": Could not load trusted cert '%s'\n",
file);
config = g_key_file_new();
// Load user config
- if (!g_key_file_load_from_file(config,
- g_build_filename(g_get_user_config_dir(),
- __NAME__, "chorizo.ini",
- NULL),
- flags, NULL)) {
+ gchar *fname = g_build_filename(g_get_user_config_dir(), __NAME__,
+ "chorizo.ini", NULL);
+ if (!g_key_file_load_from_file(config, fname, flags, NULL)) {
// Load global config
if (!g_key_file_load_from_file(config, "/etc/chorizo.ini", flags,
NULL)) {
fprintf(stderr, "Could not load chorizo.ini");
}
}
+ g_free(fname);
return config;
}
downloadmanager_setup();
mainwindow_setup();
+ client_arr = malloc(sizeof(struct Client *));
if (optind >= argc) {
client_new(cfg.home_uri, NULL, TRUE, TRUE);
} else {
if (!cfg.cooperative_instances || cfg.cooperative_alone)
gtk_main();
+ for (int i = 0; i < clients; i++) {
+ free(&(client_arr[i]));
+ }
+
exit(EXIT_SUCCESS);
}