[poppler] poppler/Form.cc

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Sat Jan 2 22:41:52 UTC 2021


 poppler/Form.cc |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit db171f489ca532e48a1c44e2e3dfb9c069754582
Author: Albert Astals Cid <aacid at kde.org>
Date:   Sat Jan 2 23:03:29 2021 +0100

    Fix memory leak if saving the file fails

diff --git a/poppler/Form.cc b/poppler/Form.cc
index f75e42f6..2eedbebc 100644
--- a/poppler/Form.cc
+++ b/poppler/Form.cc
@@ -5,7 +5,7 @@
 // This file is licensed under the GPLv2 or later
 //
 // Copyright 2006-2008 Julien Rebetez <julienr at svn.gnome.org>
-// Copyright 2007-2012, 2015-2020 Albert Astals Cid <aacid at kde.org>
+// Copyright 2007-2012, 2015-2021 Albert Astals Cid <aacid at kde.org>
 // Copyright 2007-2008, 2011 Carlos Garcia Campos <carlosgc at gnome.org>
 // Copyright 2007, 2013, 2016, 2019 Adrian Johnson <ajohnson at redneon.com>
 // Copyright 2007 Iñigo Martínez <inigomartinez at gmail.com>
@@ -549,6 +549,7 @@ bool FormWidgetSignature::signDocument(const char *saveFilename, const char *cer
     GooString *fname = new GooString(saveFilename);
     if (doc->saveAs(fname, writeForceIncremental) != errNone) {
         fprintf(stderr, "signDocument: error saving to file \"%s\"\n", saveFilename);
+        delete fname;
         return false;
     }
 


More information about the poppler mailing list