[poppler] glib/poppler-document.cc

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Nov 29 23:24:46 UTC 2021


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

New commits:
commit ff8aab1b2a16246f7c61ce5599eda0ba03298031
Author: Christian Persch <chpe at src.gnome.org>
Date:   Tue Nov 30 00:17:43 2021 +0100

    glib: Close the file descriptor on fdopen error
    
    ... and *not* the (nullptr) file.
    
    https://gitlab.freedesktop.org/poppler/poppler/-/merge_requests/995

diff --git a/glib/poppler-document.cc b/glib/poppler-document.cc
index 3f03b9f8..6d954dcd 100644
--- a/glib/poppler-document.cc
+++ b/glib/poppler-document.cc
@@ -471,7 +471,7 @@ PopplerDocument *poppler_document_new_from_fd(int fd, const char *password, GErr
             if (!file) {
                 int errsv = errno;
                 g_set_error_literal(error, G_FILE_ERROR, g_file_error_from_errno(errsv), g_strerror(errsv));
-                fclose(file);
+                close(fd);
                 return nullptr;
             }
         }


More information about the poppler mailing list