[Libreoffice-commits] core.git: sal/qa
Caolán McNamara
caolanm at redhat.com
Sun Jul 23 18:18:47 UTC 2017
sal/qa/osl/pipe/osl_Pipe.cxx | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
New commits:
commit 0a38e49ee801be8e754cbf7b800aaab5da392c6d
Author: Caolán McNamara <caolanm at redhat.com>
Date: Sun Jul 23 19:17:41 2017 +0100
coverity#1415617 Resource leak
Change-Id: Ib23bbd9403f44fd7aa3635a3febb6533b1f9edad
diff --git a/sal/qa/osl/pipe/osl_Pipe.cxx b/sal/qa/osl/pipe/osl_Pipe.cxx
index fcf227eb2541..a2f20058b36e 100644
--- a/sal/qa/osl/pipe/osl_Pipe.cxx
+++ b/sal/qa/osl/pipe/osl_Pipe.cxx
@@ -172,12 +172,12 @@ namespace osl_Pipe
void ctors_no_acquire( )
{
/// create a pipe.
- ::osl::Pipe* pPipe = new ::osl::Pipe( test::uniquePipeName(aTestPipeName), osl_Pipe_CREATE );
+ std::unique_ptr<osl::Pipe> xPipe(new osl::Pipe(test::uniquePipeName(aTestPipeName), osl_Pipe_CREATE));
/// constructs a pipe reference without acquiring the handle.
- ::osl::Pipe* pNoAcquirePipe = new ::osl::Pipe( pPipe->getHandle( ), SAL_NO_ACQUIRE );
+ std::unique_ptr<osl::Pipe> xNoAcquirePipe(new osl::Pipe(xPipe->getHandle(), SAL_NO_ACQUIRE));
- StreamPipe aStreamPipe(pPipe->getHandle());
- delete pNoAcquirePipe;
+ StreamPipe aStreamPipe(xPipe->getHandle());
+ xNoAcquirePipe.reset();
int nRet = aStreamPipe.send("a", 1);
if (nRet >= 0)
More information about the Libreoffice-commits
mailing list