summaryrefslogtreecommitdiff
path: root/sal/qa
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2018-08-30 15:06:34 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2018-08-30 18:49:45 +0200
commit416a543824caa01a07ab96f1764769d4f234f213 (patch)
treee3d56366e24ffc765e015ff22082fd4ac22b991e /sal/qa
parent81fac013cb365d711ad78a566ee1b5b13480b013 (diff)
Remove redundant asserts after new
Also remove SlideSorter::CreateController which only calls new; fix a memory leak in osl_Security's MyTestPlugInImpl::initialize Change-Id: I70b6e888984f8543adbf879162e752556d2b3f0e Reviewed-on: https://gerrit.libreoffice.org/59805 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Tested-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'sal/qa')
-rw-r--r--sal/qa/osl/security/osl_Security.cxx6
1 files changed, 1 insertions, 5 deletions
diff --git a/sal/qa/osl/security/osl_Security.cxx b/sal/qa/osl/security/osl_Security.cxx
index a1dff025ce70..94a0dcf6a1d1 100644
--- a/sal/qa/osl/security/osl_Security.cxx
+++ b/sal/qa/osl/security/osl_Security.cxx
@@ -418,11 +418,9 @@ void MyTestPlugInImpl::initialize( CPPUNIT_NS::TestFactoryRegistry *,
// Create buffers for the SID and the domain name.
PSID pSid = static_cast<PSID>(new BYTE[dwSidBufferSize]);
- CPPUNIT_ASSERT_MESSAGE("# creating SID buffer failed.\n", pSid!= nullptr );
memset( pSid, 0, dwSidBufferSize);
wszDomainName = new WCHAR[dwDomainBufferSize];
- CPPUNIT_ASSERT_MESSAGE("# creating Domain name buffer failed.\n", wszDomainName != nullptr );
memset(wszDomainName, 0, dwDomainBufferSize*sizeof(WCHAR));
// Obtain the SID for the account name passed.
@@ -454,9 +452,8 @@ void MyTestPlugInImpl::initialize( CPPUNIT_NS::TestFactoryRegistry *,
{
// Reallocate memory for the SID buffer.
wprintf(L"# The SID buffer was too small. It will be reallocated.\n");
- FreeSid( pSid);
+ delete[] static_cast<BYTE*>(pSid);
pSid = static_cast<PSID>(new BYTE[cbSid]);
- CPPUNIT_ASSERT_MESSAGE("# re-creating SID buffer failed.\n", pSid!= nullptr );
memset( pSid, 0, cbSid);
dwSidBufferSize = cbSid;
}
@@ -466,7 +463,6 @@ void MyTestPlugInImpl::initialize( CPPUNIT_NS::TestFactoryRegistry *,
wprintf(L"# The domain name buffer was too small. It will be reallocated.\n");
delete [] wszDomainName;
wszDomainName = new WCHAR[cchDomainName];
- CPPUNIT_ASSERT_MESSAGE("# re-creating domain name buffer failed.\n", wszDomainName!= nullptr );
memset(wszDomainName, 0, cchDomainName*sizeof(WCHAR));
dwDomainBufferSize = cchDomainName;
}