vcl/unx/generic/printer/cpdmgr.cxx |    8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

New commits:
commit 944c27cf195dcf928687f0a5b392c714b79ad444
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Sun Mar 21 14:58:50 2021 +0000
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Sun Mar 21 20:46:56 2021 +0100

    cid#1473820 Unchecked return value from library
    
    Change-Id: I61721dcfa1b38e224cccceb5e7cad0c2cd58f73b
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112845
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caol...@redhat.com>

diff --git a/vcl/unx/generic/printer/cpdmgr.cxx 
b/vcl/unx/generic/printer/cpdmgr.cxx
index 0789ae7e1ca7..4f375b9cc416 100644
--- a/vcl/unx/generic/printer/cpdmgr.cxx
+++ b/vcl/unx/generic/printer/cpdmgr.cxx
@@ -259,9 +259,11 @@ CPDManager* CPDManager::tryLoadCPD()
                 gchar* contents;
                 std::stringstream filepath;
                 filepath << BACKEND_DIR << '/' << filename;
-                g_file_get_contents(filepath.str().c_str(), &contents, 
nullptr, nullptr);
-                std::pair<std::string, gchar*> new_tbackend (filename, 
contents);
-                pManager->addTempBackend(new_tbackend);
+                if (g_file_get_contents(filepath.str().c_str(), &contents, 
nullptr, nullptr))
+                {
+                    std::pair<std::string, gchar*> new_tbackend (filename, 
contents);
+                    pManager->addTempBackend(new_tbackend);
+                }
             }
             g_dir_close(dir);
         }
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to