[poppler] glib/poppler-document.cc

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


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

New commits:
commit 4d0786a97e061a752686968bd7976bdda01b1f84
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 ec56698..9d5e52c 100644
--- a/glib/poppler-document.cc
+++ b/glib/poppler-document.cc
@@ -86,8 +86,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())
@@ -127,6 +125,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