sal/osl/unx/profile.cxx |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 8c37211e00440eeb33b281db1c9ac8c9d58c3aa9
Author:     Caolán McNamara <caolan.mcnam...@collabora.com>
AuthorDate: Sun Jul 13 16:14:29 2025 +0100
Commit:     Stephan Bergmann <stephan.bergm...@collabora.com>
CommitDate: Mon Jul 14 11:23:10 2025 +0200

    cid#1659049 Resource leak
    
    Change-Id: I60637a01ff7cbe50e4df264d3c401799772743f0
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/187808
    Reviewed-by: Stephan Bergmann <stephan.bergm...@collabora.com>
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>

diff --git a/sal/osl/unx/profile.cxx b/sal/osl/unx/profile.cxx
index b769b0ae90b3..05026da5e6fb 100644
--- a/sal/osl/unx/profile.cxx
+++ b/sal/osl/unx/profile.cxx
@@ -935,12 +935,13 @@ static bool OslProfile_lockFile(const osl_TFile* pFile, 
osl_TLockMode eMode)
 static osl_TFile* openFileImpl(const char* pszFilename, oslProfileOption 
ProfileFlags )
 {
     int        Flags;
-    osl_TFile* pFile = static_cast<osl_TFile*>(calloc(1, sizeof(osl_TFile)));
     bool       bWriteable = false;
 
     if ( isForbidden( pszFilename, osl_File_OpenFlag_Write ) )
         return nullptr;
 
+    osl_TFile* pFile = static_cast<osl_TFile*>(calloc(1, sizeof(osl_TFile)));
+
     if ( ProfileFlags & ( osl_Profile_WRITELOCK | osl_Profile_FLUSHWRITE ) )
     {
         bWriteable = true;

Reply via email to