[Libreoffice-commits] core.git: sw/source

Norbert Thiebaud nthiebaud at gmail.com
Mon Feb 18 07:52:11 PST 2013


 sw/source/core/doc/docfld.cxx |    9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

New commits:
commit 9cacdd26a010a9ea6e55a1f00d95e8afc924558d
Author: Norbert Thiebaud <nthiebaud at gmail.com>
Date:   Sun Feb 17 15:12:54 2013 -0600

    coverity#983197 Resource leak
    
    Change-Id: Iccf3d16b39919931d17dc74f2e9ece127be8aa89
    Reviewed-on: https://gerrit.libreoffice.org/2205
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sw/source/core/doc/docfld.cxx b/sw/source/core/doc/docfld.cxx
index 039843d..3f95668 100644
--- a/sw/source/core/doc/docfld.cxx
+++ b/sw/source/core/doc/docfld.cxx
@@ -1769,10 +1769,11 @@ void SwDoc::GetAllDBNames( std::vector<String>& rAllDBNames )
     for(sal_uInt16 i = 0; i < rArr.size(); i++)
     {
         const SwDSParam* pParam = &rArr[i];
-        String* pStr = new String( pParam->sDataSource );
-        (*pStr) += DB_DELIM;
-        (*pStr) += (String)pParam->sCommand;
-        rAllDBNames.push_back(*pStr);
+        OUStringBuffer sStr(pParam->sDataSource.getLength() + pParam->sCommand.getLength() + 2);
+        sStr.append(pParam->sDataSource );
+        sStr.append(DB_DELIM);
+        sStr.append(pParam->sCommand);
+        rAllDBNames.push_back(sStr.makeStringAndClear());
     }
 }
 


More information about the Libreoffice-commits mailing list