From 0e72cbc19a60dceb97c338a7a79298fb7616ac69 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Mon, 15 Dec 2014 03:28:08 +0100 Subject: [PATCH] Fix use-after-free issue Signed-off-by: Sebastian Ramacher --- zathura/zathura.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zathura/zathura.c b/zathura/zathura.c index 819572c..2a76810 100644 --- a/zathura/zathura.c +++ b/zathura/zathura.c @@ -223,13 +223,13 @@ zathura_init(zathura_t* zathura) } else if (g_strcmp0(database, "null") != 0) { girara_error("Database backend '%s' is not supported.", database); } - g_free(database); if (zathura->database == NULL && g_strcmp0(database, "null") != 0) { girara_error("Unable to initialize database. Bookmarks won't be available."); } else { g_object_set(G_OBJECT(zathura->ui.session->command_history), "io", zathura->database, NULL); } + g_free(database); /* bookmarks */ zathura->bookmarks.bookmarks = girara_sorted_list_new2((girara_compare_function_t) zathura_bookmarks_compare,