[poppler] Branch 'poppler-0.20' - glib/poppler-document.cc

Carlos Garcia Campos carlosgc at kemper.freedesktop.org
Sun May 13 10:31:50 PDT 2012


 glib/poppler-document.cc |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

New commits:
commit 7714b4e319c48ee915061a172208245ae7c4141b
Author: Carlos Garcia Campos <carlosgc at gnome.org>
Date:   Sun May 13 19:30:17 2012 +0200

    glib: Fix memory leak when document fails to load

diff --git a/glib/poppler-document.cc b/glib/poppler-document.cc
index a78b5ec..21cace8 100644
--- a/glib/poppler-document.cc
+++ b/glib/poppler-document.cc
@@ -84,8 +84,6 @@ _poppler_document_new_from_pdfdoc (PDFDoc  *newDoc,
 {
   PopplerDocument *document;
 
-  document = (PopplerDocument *) g_object_new (POPPLER_TYPE_DOCUMENT, NULL, NULL);
-
   if (!newDoc->isOk()) {
     int fopen_errno;
     switch (newDoc->getErrorCode())
@@ -125,6 +123,7 @@ _poppler_document_new_from_pdfdoc (PDFDoc  *newDoc,
     return NULL;
   }
 
+  document = (PopplerDocument *) g_object_new (POPPLER_TYPE_DOCUMENT, NULL);
   document->doc = newDoc;
 
   document->output_dev = new CairoOutputDev ();


More information about the poppler mailing list