From f7e9c3d770bf7fd04c9b301cc21e6ac6a564d71a Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Fri, 21 Oct 2011 23:40:16 +0200 Subject: [PATCH] remove duplicated code --- document.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/document.c b/document.c index 291b571..b548f32 100644 --- a/document.c +++ b/document.c @@ -291,19 +291,13 @@ zathura_document_free(zathura_document_t* document) free(document->pages); /* free document */ + bool r = true; if (document->functions.document_free == NULL) { girara_error("%s not implemented", __FUNCTION__); - - if (document->file_path != NULL) { - free(document->file_path); - } - - g_free(document); - return true; + } else { + r = document->functions.document_free(document); } - bool r = document->functions.document_free(document); - if (document->file_path != NULL) { free(document->file_path); }