[Libreoffice-commits] core.git: 18 commits - basctl/source connectivity/source extensions/source i18npool/source jvmfwk/plugins salhelper/qa sal/osl sfx2/source solenv/bin sot/source toolkit/source

Markus Mohrhard markus.mohrhard at googlemail.com
Sat Mar 2 19:36:01 PST 2013


 basctl/source/dlged/dlgedfac.cxx                 |    2 ++
 connectivity/source/drivers/jdbc/Timestamp.cxx   |    9 ++++++---
 extensions/source/scanner/sanedlg.cxx            |    1 +
 i18npool/source/localedata/localedata.cxx        |    4 ++++
 jvmfwk/plugins/sunmajor/javaenvsetup/javaldx.cxx |    3 +++
 sal/osl/unx/conditn.cxx                          |    2 ++
 sal/osl/unx/file_url.cxx                         |    4 +++-
 sal/osl/unx/profile.c                            |    1 +
 sal/osl/unx/util.c                               |    3 +++
 salhelper/qa/test_api.cxx                        |    2 ++
 sfx2/source/menu/mnumgr.cxx                      |    1 +
 solenv/bin/concat-deps.c                         |    2 +-
 sot/source/sdstor/stgdir.cxx                     |    4 ++++
 toolkit/source/awt/vclxmenu.cxx                  |    4 +---
 toolkit/source/awt/vclxtoolkit.cxx               |    2 +-
 15 files changed, 35 insertions(+), 9 deletions(-)

New commits:
commit 21171e0a7fd3aaa14a45a72bfecbc2b2a4ad7679
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Sun Mar 3 04:29:23 2013 +0100

    coverity#736112: make clear that this is not part of the if
    
    Change-Id: I442d7e363f7594d1fae5e2afdde71ff6670b1962

diff --git a/connectivity/source/drivers/jdbc/Timestamp.cxx b/connectivity/source/drivers/jdbc/Timestamp.cxx
index 77f123a..1d541d8 100644
--- a/connectivity/source/drivers/jdbc/Timestamp.cxx
+++ b/connectivity/source/drivers/jdbc/Timestamp.cxx
@@ -166,7 +166,8 @@ java_sql_Timestamp::java_sql_Timestamp(const ::com::sun::star::util::DateTime& _
     jobject tempObj;
     static jmethodID mID(NULL);
     if ( !mID  )
-        mID  = t.pEnv->GetStaticMethodID( getMyClass(), "valueOf", cSignature );OSL_ENSURE(mID,"Unknown method id!");
+        mID  = t.pEnv->GetStaticMethodID( getMyClass(), "valueOf", cSignature );
+    OSL_ENSURE(mID,"Unknown method id!");
     tempObj = t.pEnv->CallStaticObjectMethod( getMyClass(), mID, args[0].l );
 
     saveRef( t.pEnv, tempObj );
commit bcca57ac426e84b5d359dea84fdac76a5495679b
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Sun Mar 3 04:28:16 2013 +0100

    coverity#736111: make clear that this is not part of the if
    
    Change-Id: Iab61e80a7fa8f01d826ac90e184d09d0e2358b40

diff --git a/connectivity/source/drivers/jdbc/Timestamp.cxx b/connectivity/source/drivers/jdbc/Timestamp.cxx
index 72ce65d..77f123a 100644
--- a/connectivity/source/drivers/jdbc/Timestamp.cxx
+++ b/connectivity/source/drivers/jdbc/Timestamp.cxx
@@ -112,7 +112,8 @@ java_sql_Time::java_sql_Time( const ::com::sun::star::util::Time& _rOut ): java_
     jobject tempObj;
     static jmethodID mID(NULL);
     if ( !mID  )
-        mID  = t.pEnv->GetStaticMethodID( getMyClass(), "valueOf", cSignature );OSL_ENSURE(mID,"Unknown method id!");
+        mID  = t.pEnv->GetStaticMethodID( getMyClass(), "valueOf", cSignature );
+    OSL_ENSURE(mID,"Unknown method id!");
     tempObj = t.pEnv->CallStaticObjectMethod( getMyClass(), mID, args[0].l );
     t.pEnv->DeleteLocalRef((jstring)args[0].l);
     saveRef( t.pEnv, tempObj );
commit 77c0cc3b750d516ad88481262d090ce0a2118e23
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Sun Mar 3 04:27:17 2013 +0100

    coverity#736110: make clear that this is not part of the if
    
    Change-Id: I709672e9e2789213c85878d2bd0194ad5bc34060

diff --git a/connectivity/source/drivers/jdbc/Timestamp.cxx b/connectivity/source/drivers/jdbc/Timestamp.cxx
index 403935a..72ce65d 100644
--- a/connectivity/source/drivers/jdbc/Timestamp.cxx
+++ b/connectivity/source/drivers/jdbc/Timestamp.cxx
@@ -46,7 +46,8 @@ java_sql_Date::java_sql_Date( const ::com::sun::star::util::Date& _rOut ) : java
     jobject tempObj;
     static jmethodID mID(NULL);
     if ( !mID  )
-        mID  = t.pEnv->GetStaticMethodID( getMyClass(), "valueOf", cSignature );OSL_ENSURE(mID,"Unknown method id!");
+        mID  = t.pEnv->GetStaticMethodID( getMyClass(), "valueOf", cSignature );
+    OSL_ENSURE(mID,"Unknown method id!");
     tempObj = t.pEnv->CallStaticObjectMethod( getMyClass(), mID, args[0].l );
     saveRef( t.pEnv, tempObj );
     t.pEnv->DeleteLocalRef( tempObj );
commit 30975b96e84ac313eb220a1d4812e42013780b95
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Sun Mar 3 04:25:11 2013 +0100

    coverity#736107: nesting level mismatch
    
    Change-Id: I24655d0e87335ac0356a1082fd993a87613e213e

diff --git a/basctl/source/dlged/dlgedfac.cxx b/basctl/source/dlged/dlgedfac.cxx
index 9c117eb..1ffbff2 100644
--- a/basctl/source/dlged/dlgedfac.cxx
+++ b/basctl/source/dlged/dlgedfac.cxx
@@ -84,8 +84,10 @@ IMPL_LINK( DlgEdFactory, MakeObject, SdrObjFactory *, pObjFactory )
                  if ( pObjFactory->nIdentifier == OBJ_DLG_CHECKBOX )
                      pObjFactory->pNewObj = new DlgEdObj( "com.sun.star.awt.UnoControlCheckBoxModel", xDialogSFact );
                  else
+                 {
                      pObjFactory->pNewObj = new DlgEdObj( "com.sun.star.form.component.CheckBox", xDialogSFact );
                      static_cast< DlgEdObj* >( pObjFactory->pNewObj )->MakeDataAware( mxModel );
+                 }
                  break;
             case OBJ_DLG_FORMLIST:
             case OBJ_DLG_LISTBOX:
commit a51cd484c6de3513a331bfe23c3b184b30ac6a21
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Sun Mar 3 04:17:15 2013 +0100

    cverity#736478: leaked file descriptors
    
    Change-Id: I0e79f3e330fe1535c473d49010da34b04b9c5875

diff --git a/solenv/bin/concat-deps.c b/solenv/bin/concat-deps.c
index 2a0889d..5b478aa 100644
--- a/solenv/bin/concat-deps.c
+++ b/solenv/bin/concat-deps.c
@@ -670,9 +670,9 @@ int fd;
                         rc = EIO;
                     }
                 }
-                close(fd);
                 buffer[*size] = 0;
             }
+            close(fd);
         }
     }
 
commit c95d4a7701a34c53459bd5d8e66574f13c758014
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Sun Mar 3 04:13:32 2013 +0100

    coverity#705720: fix memory leak
    
    Change-Id: I374f22ae6cc20c14adb99cd9bc6da1f830067861

diff --git a/sfx2/source/menu/mnumgr.cxx b/sfx2/source/menu/mnumgr.cxx
index b085e37..c4e0ee2 100644
--- a/sfx2/source/menu/mnumgr.cxx
+++ b/sfx2/source/menu/mnumgr.cxx
@@ -167,6 +167,7 @@ PopupMenu* InsertThesaurusSubmenu_Impl( SfxBindings* pBindings, Menu* pSVMenu )
         aThesLookUpStr = pStrItem->GetValue();
         nDelimPos = aThesLookUpStr.SearchBackward( '#' );
     }
+    delete pItem;
     if (aThesLookUpStr.Len() > 0 && nDelimPos != STRING_NOTFOUND)
     {
         // get synonym list for sub menu
commit ea4555100a9079f1729afabdd7046d1826b052fd
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Sun Mar 3 04:10:17 2013 +0100

    coverity#705669: fix memory leak
    
    Change-Id: Ib99c5e5c4a8c3c6efd0ff0665c73b241790b314b

diff --git a/jvmfwk/plugins/sunmajor/javaenvsetup/javaldx.cxx b/jvmfwk/plugins/sunmajor/javaenvsetup/javaldx.cxx
index bbffc8c..c94b8b4 100644
--- a/jvmfwk/plugins/sunmajor/javaenvsetup/javaldx.cxx
+++ b/jvmfwk/plugins/sunmajor/javaenvsetup/javaldx.cxx
@@ -109,7 +109,10 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv)
          aVendor != "BEA Systems, Inc." &&
          aVendor != "Free Software Foundation, Inc." &&
          aVendor != "The FreeBSD Foundation" )
+    {
+        jfw_freeJavaInfo(pInfo);
         return 0;
+    }
 
     rtl::OString sPaths = getLD_LIBRARY_PATH(pInfo->arVendorData);
     fprintf(stdout, "%s\n", sPaths.getStr());
commit 39f821c9624604412e0f5a91a4390ab8853861e1
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Sun Mar 3 04:07:23 2013 +0100

    coverity#705657: fix memory leak
    
    Change-Id: I326d2d168d48016d6f1784ff947edd17eb398838

diff --git a/i18npool/source/localedata/localedata.cxx b/i18npool/source/localedata/localedata.cxx
index cda6263..5880d11 100644
--- a/i18npool/source/localedata/localedata.cxx
+++ b/i18npool/source/localedata/localedata.cxx
@@ -1554,6 +1554,10 @@ LocaleData::getAllInstalledLocaleNames() throw(RuntimeException)
             }
             seq[nInstalled++] = tmpLocale;
         }
+        else
+        {
+            delete pCachedItem;
+        }
     }
     if ( nInstalled < nbOfLocales )
         seq.realloc( nInstalled );          // reflect reality
commit a050b17880104f3cd172a1cfdc969110cb27f172
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Sun Mar 3 04:03:15 2013 +0100

    coverity#705648: fix memory leak
    
    Change-Id: I1ba301831758f2ba05226588ec71b1a911d7bbba

diff --git a/extensions/source/scanner/sanedlg.cxx b/extensions/source/scanner/sanedlg.cxx
index a69a452..36feba6 100644
--- a/extensions/source/scanner/sanedlg.cxx
+++ b/extensions/source/scanner/sanedlg.cxx
@@ -619,6 +619,7 @@ IMPL_LINK( SaneDlg, ModifyHdl, Edit*, pEdit )
                     if( fRes > pDouble[ 1 ] )
                         fRes = pDouble[ 1 ];
                 }
+                delete[] pDouble;
                 maReslBox.SetValue( (sal_uLong)fRes );
             }
         }
commit b55d15e3af60ab9f5c5b6f2c97ec5c8a29396429
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Sun Mar 3 03:55:35 2013 +0100

    coverity#735368: operation has no effect
    
    Change-Id: Ibdb36f3b1df04dca7c4129ef4837317c991d7ae9

diff --git a/toolkit/source/awt/vclxtoolkit.cxx b/toolkit/source/awt/vclxtoolkit.cxx
index fb167e5..479f88b 100644
--- a/toolkit/source/awt/vclxtoolkit.cxx
+++ b/toolkit/source/awt/vclxtoolkit.cxx
@@ -232,7 +232,7 @@ TOOLKIT_DLLPUBLIC WinBits ImplGetWinBits( sal_uInt32 nComponentAttribs, sal_uInt
         if( nComponentAttribs & ::com::sun::star::awt::VclWindowPeerAttribute::DEF_NO )
             nWinBits |= WB_DEF_NO;
     }
-    if ( nCompType == WINDOW_MULTILINEEDIT || nCompType == WINDOW_DIALOG || WINDOW_GROUPBOX )
+    if ( nCompType == WINDOW_MULTILINEEDIT || nCompType == WINDOW_DIALOG || nCompType == WINDOW_GROUPBOX )
     {
         if( nComponentAttribs & ::com::sun::star::awt::VclWindowPeerAttribute::AUTOHSCROLL )
             nWinBits |= WB_AUTOHSCROLL;
commit 224137a2fbef0cc6c4ab3d14aff4f28684ab2e8f
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Sat Mar 2 17:09:10 2013 +0100

    coverity#705121: missing unlock of mutex
    
    Change-Id: Ib36a2f0ada0f0e1af631f3a1698a44edbd3dd59e

diff --git a/sal/osl/unx/profile.c b/sal/osl/unx/profile.c
index 89fdc5d..4af9990 100644
--- a/sal/osl/unx/profile.c
+++ b/sal/osl/unx/profile.c
@@ -511,6 +511,7 @@ sal_Bool SAL_CALL osl_readProfileString(oslProfile Profile,
 
     if ( pProfile == NULL )
     {
+        pthread_mutex_unlock(&(pTmpProfile->m_AccessLock));
 #ifdef TRACE_OSL_PROFILE
         OSL_TRACE("Out osl_readProfileString [pProfile==0]");
 #endif
commit 914018c03a492f433e1ae5081aa3184cded9783f
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Sat Mar 2 17:07:50 2013 +0100

    coverity#705120: missing unlock of mutex
    
    Change-Id: I341ba77e459967ece5916ed897b76e9f63164e58

diff --git a/sal/osl/unx/conditn.cxx b/sal/osl/unx/conditn.cxx
index f84ae28..90d70e1 100644
--- a/sal/osl/unx/conditn.cxx
+++ b/sal/osl/unx/conditn.cxx
@@ -152,6 +152,8 @@ sal_Bool SAL_CALL osl_setCondition(oslCondition Condition)
            "sal.osl",
            "pthread_cond_broadcast failed, errno " << nRet << ", \""
                << strerror(nRet) << '"');
+       // try to unlock the mutex
+       pthread_mutex_unlock(&pCond->m_Lock);
        return sal_False;
    }
 
commit 23f124bf95cbd395d9964502d9c1a6d28a6ff203
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Sat Mar 2 12:04:22 2013 +0100

    coverity#983201: fix memory leak
    
    Change-Id: I0c6a4ed147c6afc1dcabaa33833b7ca50afb4607

diff --git a/toolkit/source/awt/vclxmenu.cxx b/toolkit/source/awt/vclxmenu.cxx
index fbda6cd..01a6895 100644
--- a/toolkit/source/awt/vclxmenu.cxx
+++ b/toolkit/source/awt/vclxmenu.cxx
@@ -528,9 +528,7 @@ void VCLXMenu::setPopupMenu( sal_Int16 nItemId, const ::com::sun::star::uno::Ref
         // if the popup men is not created by stardiv.Toolkit.VCLXPopupMenu
         if( !aRef.is() )
         {
-            ::com::sun::star::uno::Reference< ::com::sun::star::awt::XPopupMenu > * pNewRef = new ::com::sun::star::uno::Reference< ::com::sun::star::awt::XPopupMenu > ;
-            *pNewRef = new VCLXPopupMenu( (PopupMenu*)pMenu );
-            aRef = *pNewRef;
+            aRef = new VCLXPopupMenu( (PopupMenu*)pMenu );
         }
     }
     return aRef;
commit 48d099a85a3293074070ca91f4465f479cb3b90c
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Sat Mar 2 11:47:26 2013 +0100

    coverity#705725: fix memory leak
    
    Change-Id: I862ea9c4958497cc338b93bd0852c0b1494aee81

diff --git a/sot/source/sdstor/stgdir.cxx b/sot/source/sdstor/stgdir.cxx
index 31c2de2..dedb7cd 100644
--- a/sot/source/sdstor/stgdir.cxx
+++ b/sot/source/sdstor/stgdir.cxx
@@ -883,6 +883,10 @@ void StgDirStrm::SetupEntry( sal_Int32 n, StgDirEntry* pUpper )
             SetupEntry( nRight, pUpper );
             SetupEntry( nLeaf, pCur );
         }
+        else
+        {
+            delete pCur;
+        }
     }
 }
 
commit 887ed7f13b3555caaf6d8f3622cd140cc72a51cb
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Sat Mar 2 11:36:16 2013 +0100

    coverity#983108: fix memory leak
    
    Change-Id: Ief22e3cbb826ab0ceca5d199c1bfd21b46e87358

diff --git a/salhelper/qa/test_api.cxx b/salhelper/qa/test_api.cxx
index 15c779f..8b98ef3 100644
--- a/salhelper/qa/test_api.cxx
+++ b/salhelper/qa/test_api.cxx
@@ -237,6 +237,7 @@ void Test::testDerivedSimpleReferenceObject() {
         delete static_cast< DerivedSimpleReferenceObject * >(p);
         throw;
     }
+    delete static_cast< DerivedSimpleReferenceObject * >(p);
 }
 
 CPPUNIT_TEST_SUITE_REGISTRATION(Test);
commit 9999bb82fa7c9ea74bd23f2bec07ed89289d2988
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Sat Mar 2 11:35:18 2013 +0100

    coverity#983107: fix memory leak
    
    Change-Id: I602510657d72455485e42e66b8ddf68413035232

diff --git a/salhelper/qa/test_api.cxx b/salhelper/qa/test_api.cxx
index afddab1..15c779f 100644
--- a/salhelper/qa/test_api.cxx
+++ b/salhelper/qa/test_api.cxx
@@ -207,6 +207,7 @@ void Test::testSimpleReferenceObject() {
         delete static_cast< DerivedSimpleReferenceObject * >(p);
         throw;
     }
+    delete static_cast< DerivedSimpleReferenceObject * >(p);
 }
 
 void Test::testDerivedCondition() {
commit f3c849fbcc9833987b6da2d4cb837bcc96e79d28
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Sat Mar 2 11:31:48 2013 +0100

    coverity#983100: close resource handle
    
    Change-Id: I7e637fcafff08e4299a90887dbcfc60613377c9d

diff --git a/sal/osl/unx/util.c b/sal/osl/unx/util.c
index dca2963..6118a5f 100644
--- a/sal/osl/unx/util.c
+++ b/sal/osl/unx/util.c
@@ -122,7 +122,10 @@ static int osl_getHWAddr(const char *ifname, char* hard_addr)
     int so = socket(AF_INET, SOCK_DGRAM, 0);
 
     if (strlen(ifname) >= sizeof(ifr.ifr_name))
+    {
+        close(so);
         return 0;
+    }
 
     strcpy(ifr.ifr_name, ifname);
 
commit c04fde0063276e3d5a6de3e077c1c822ed1ad25e
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Sat Mar 2 11:29:44 2013 +0100

    coverity#983099: fix memory leak
    
    Change-Id: I2fe582bc9b082ab4cac7cc7e6c521087f4906436

diff --git a/sal/osl/unx/file_url.cxx b/sal/osl/unx/file_url.cxx
index 203d17f..e800a59 100644
--- a/sal/osl/unx/file_url.cxx
+++ b/sal/osl/unx/file_url.cxx
@@ -332,7 +332,9 @@ oslFileError SAL_CALL osl_getFileURLFromSystemPath( rtl_uString *ustrSystemPath,
         if( ( 1 == ustrSystemPath->length ) || ( (sal_Unicode)'/' == ustrSystemPath->buffer[1] ) )
         {
             /* osl_getHomeDir returns file URL */
-            osl_getHomeDir( osl_getCurrentSecurity(), &pTmp );
+            oslSecurity pSecurity = osl_getCurrentSecurity();
+            osl_getHomeDir( pSecurity , &pTmp );
+            osl_freeSecurityHandle( pSecurity );
 
             /* remove "file://" prefix */
             rtl_uString_newFromStr_WithLength( &pTmp, pTmp->buffer + 7, pTmp->length - 7 );


More information about the Libreoffice-commits mailing list