[Libreoffice-commits] .: 4 commits - sal/qa

Caolán McNamara caolan at kemper.freedesktop.org
Tue Apr 5 01:28:51 PDT 2011


 sal/qa/osl/process/osl_Thread.cxx |    4 ++++
 sal/qa/rtl/cipher/rtl_cipher.cxx  |   10 ++++++++++
 sal/qa/rtl/locale/rtl_locale.cxx  |    6 +++---
 3 files changed, 17 insertions(+), 3 deletions(-)

New commits:
commit 4e2a7fde5ed88e3a471941626dec9e9030323ef2
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Apr 5 09:19:42 2011 +0100

    valgrind: fix leak

diff --git a/sal/qa/osl/process/osl_Thread.cxx b/sal/qa/osl/process/osl_Thread.cxx
index 3b021a4..31dd18e 100644
--- a/sal/qa/osl/process/osl_Thread.cxx
+++ b/sal/qa/osl/process/osl_Thread.cxx
@@ -2059,6 +2059,7 @@ namespace osl_ThreadData
                     cData1 == 'a' && cData2 == 'b' && aChar == 'm'
                     );
 
+                delete [] pc;
             }
         /** setData the second time, and then getData
          */
commit eb8dc1fcbe364adac31f8dfb0b8173312fc3a518
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Apr 4 21:37:25 2011 +0100

    valgrind: fix mem leak

diff --git a/sal/qa/osl/process/osl_Thread.cxx b/sal/qa/osl/process/osl_Thread.cxx
index 724cdbe..3b021a4 100644
--- a/sal/qa/osl/process/osl_Thread.cxx
+++ b/sal/qa/osl/process/osl_Thread.cxx
@@ -2098,6 +2098,8 @@ namespace osl_ThreadData
                     cData1 == 'a' && cData2 == 'b' && aChar == 'o'
                     );
 
+                delete [] pc2;
+                delete [] pc;
             }
 
         CPPUNIT_TEST_SUITE(setData);
@@ -2146,6 +2148,7 @@ namespace osl_ThreadData
                     cData1 == 'c' && cData2 == 'd' && aChar == 'i'
                     );
 
+                delete [] pc;
             }
 
         // setData then change the value in the address data pointer points,
commit e6d54bd895aeb6d452856f1228b437e2660764e0
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Apr 4 21:33:16 2011 +0100

    valgrind: fix mem leak

diff --git a/sal/qa/rtl/cipher/rtl_cipher.cxx b/sal/qa/rtl/cipher/rtl_cipher.cxx
index ac05f2b..647d0f5 100644
--- a/sal/qa/rtl/cipher/rtl_cipher.cxx
+++ b/sal/qa/rtl/cipher/rtl_cipher.cxx
@@ -232,6 +232,16 @@ public:
 
             /* rtlCipherError */ aError = rtl_cipher_decode(aCipher, pCipherBuffer, nCipherLen, pPlainText2Buffer, nPlainText2Len);
             CPPUNIT_ASSERT_MESSAGE("decode should not work", aError != rtl_Cipher_E_None);
+
+            delete [] pPlainText2Buffer;
+
+            delete [] pCipherBuffer;
+            delete [] pPlainTextBuffer;
+
+            delete [] pArgBuffer;
+            delete [] pKeyBuffer;
+
+            rtl_cipher_destroy(aCipher);
         }
 
     void test_encode_and_decode(sal_uInt8 _nKeyValue, sal_uInt8 _nArgValue, rtl::OString const& _sPlainTextStr)
commit cea16889d612cfd8faba1bd17dd96278e3e0bdf2
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Apr 4 21:21:55 2011 +0100

    shouldn't double-acquire

diff --git a/sal/qa/rtl/locale/rtl_locale.cxx b/sal/qa/rtl/locale/rtl_locale.cxx
index 12ced3b..4f2b3dd 100644
--- a/sal/qa/rtl/locale/rtl_locale.cxx
+++ b/sal/qa/rtl/locale/rtl_locale.cxx
@@ -149,7 +149,7 @@ public:
     void getLanguage_002()
     {
         rtl::OLocale aLocale = ::rtl::OLocale::getDefault();
-        rtl::OUString suLanguage = rtl_locale_getLanguage(aLocale.getData());
+        rtl::OUString suLanguage(rtl_locale_getLanguage(aLocale.getData()), SAL_NO_ACQUIRE);
         CPPUNIT_ASSERT_MESSAGE("locale language must be 'de'", suLanguage.equals(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("de"))));
     }
 
@@ -188,7 +188,7 @@ public:
     void getCountry_002()
     {
         rtl::OLocale aLocale = ::rtl::OLocale::getDefault();
-        rtl::OUString suCountry = rtl_locale_getCountry(aLocale.getData());
+        rtl::OUString suCountry(rtl_locale_getCountry(aLocale.getData()), SAL_NO_ACQUIRE);
         CPPUNIT_ASSERT_MESSAGE("locale country must be 'DE'", suCountry.equals(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DE"))));
     }
 
@@ -227,7 +227,7 @@ public:
     void getVariant_002()
     {
         rtl::OLocale aLocale = ::rtl::OLocale::getDefault();
-        rtl::OUString suVariant = rtl_locale_getVariant(aLocale.getData());
+        rtl::OUString suVariant(rtl_locale_getVariant(aLocale.getData()), SAL_NO_ACQUIRE);
         CPPUNIT_ASSERT_MESSAGE("locale variant must be 'hochdeutsch'", suVariant.equals(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("hochdeutsch"))));
     }
 


More information about the Libreoffice-commits mailing list