summaryrefslogtreecommitdiff
path: root/sal/workben
diff options
context:
space:
mode:
authorMark Wielaard <mark@klomp.org>2013-07-17 12:11:26 +0200
committerDavid Tardon <dtardon@redhat.com>2013-07-17 10:57:21 +0000
commitcae861f0b32e01cb775214d783c98255acb60af0 (patch)
treef94d5786080416ef396cc19a4826ab1e409b42ec /sal/workben
parent4cf02127888589d66c90286e9994b5cf07ea3cab (diff)
Fix memory leak with osl_getCurrentSecurity ().
The result of osl_getCurrentSecurity () should always be deleted again with osl_freeSecurityHandle (). Change-Id: If0991937fcb24207d1f78166f61c4be22d423629 Reviewed-on: https://gerrit.libreoffice.org/4947 Reviewed-by: David Tardon <dtardon@redhat.com> Tested-by: David Tardon <dtardon@redhat.com>
Diffstat (limited to 'sal/workben')
-rw-r--r--sal/workben/t_osl_joinProcess.cxx16
1 files changed, 12 insertions, 4 deletions
diff --git a/sal/workben/t_osl_joinProcess.cxx b/sal/workben/t_osl_joinProcess.cxx
index 8f3497d5b5ec..d043c5e343b3 100644
--- a/sal/workben/t_osl_joinProcess.cxx
+++ b/sal/workben/t_osl_joinProcess.cxx
@@ -46,16 +46,18 @@ public:
void test_osl_joinProcessWithTimeout_timeout_failure()
{
oslProcess process;
+ oslSecurity security = osl_getCurrentSecurity();
oslProcessError osl_error = osl_executeProcess(
IMAGE_NAME.pData,
NULL,
0,
osl_Process_NORMAL,
- osl_getCurrentSecurity(),
+ security,
CWD.pData,
NULL,
0,
&process);
+ osl_freeSecurityHandle(security);
CPPUNIT_ASSERT_MESSAGE
(
@@ -96,16 +98,18 @@ public:
void test_osl_joinProcessWithTimeout_without_timeout_failure()
{
oslProcess process;
+ oslSecurity security = osl_getCurrentSecurity();
oslProcessError osl_error = osl_executeProcess(
IMAGE_NAME.pData,
NULL,
0,
osl_Process_NORMAL,
- osl_getCurrentSecurity(),
+ security,
CWD.pData,
NULL,
0,
&process);
+ osl_freeSecurityHandle(security);
CPPUNIT_ASSERT_MESSAGE
(
@@ -136,16 +140,18 @@ public:
void test_osl_joinProcessWithTimeout_infinite()
{
oslProcess process;
+ oslSecurity security = osl_getCurrentSecurity();
oslProcessError osl_error = osl_executeProcess(
IMAGE_NAME.pData,
NULL,
0,
osl_Process_NORMAL,
- osl_getCurrentSecurity(),
+ security,
CWD.pData,
NULL,
0,
&process);
+ osl_freeSecurityHandle(security);
CPPUNIT_ASSERT_MESSAGE
(
@@ -172,16 +178,18 @@ public:
void test_osl_joinProcess()
{
oslProcess process;
+ oslSecurity security = osl_getCurrentSecurity();
oslProcessError osl_error = osl_executeProcess(
IMAGE_NAME.pData,
NULL,
0,
osl_Process_NORMAL,
- osl_getCurrentSecurity(),
+ security,
CWD.pData,
NULL,
0,
&process);
+ osl_freeSecurityHandle(security);
CPPUNIT_ASSERT_MESSAGE
(