Commit 0e72cbc1 authored by Sebastian Ramacher's avatar Sebastian Ramacher
Browse files

Fix use-after-free issue


Signed-off-by: Sebastian Ramacher's avatarSebastian Ramacher <sebastian+dev@ramacher.at>
parent 5780a992
...@@ -223,13 +223,13 @@ zathura_init(zathura_t* zathura) ...@@ -223,13 +223,13 @@ zathura_init(zathura_t* zathura)
} else if (g_strcmp0(database, "null") != 0) { } else if (g_strcmp0(database, "null") != 0) {
girara_error("Database backend '%s' is not supported.", database); girara_error("Database backend '%s' is not supported.", database);
} }
g_free(database);
if (zathura->database == NULL && g_strcmp0(database, "null") != 0) { if (zathura->database == NULL && g_strcmp0(database, "null") != 0) {
girara_error("Unable to initialize database. Bookmarks won't be available."); girara_error("Unable to initialize database. Bookmarks won't be available.");
} else { } else {
g_object_set(G_OBJECT(zathura->ui.session->command_history), "io", zathura->database, NULL); g_object_set(G_OBJECT(zathura->ui.session->command_history), "io", zathura->database, NULL);
} }
g_free(database);
/* bookmarks */ /* bookmarks */
zathura->bookmarks.bookmarks = girara_sorted_list_new2((girara_compare_function_t) zathura_bookmarks_compare, zathura->bookmarks.bookmarks = girara_sorted_list_new2((girara_compare_function_t) zathura_bookmarks_compare,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment