From 735b31e2a5ae37b2e237c1860eaaaf1ee98fe97b Mon Sep 17 00:00:00 2001 From: Moritz Lipp Date: Tue, 9 Sep 2014 17:28:10 +0200 Subject: [PATCH] Prevent double-free in zathura_document_free --- document.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/document.c b/document.c index 4d4c76a..29781b6 100644 --- a/document.c +++ b/document.c @@ -173,13 +173,16 @@ error_free: if (file != NULL) { g_object_unref(file); } + g_free(real_path); if (document != NULL) { zathura_document_free(document); + document = NULL; /* prevent double-free */ } g_free(document); + return NULL; }