diff options
author | Caolán McNamara <caolanm@redhat.com> | 2017-07-23 19:17:41 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2017-07-23 19:17:41 +0100 |
commit | 0a38e49ee801be8e754cbf7b800aaab5da392c6d (patch) | |
tree | 1984633b4bcfa32e9a9ed28f2c08d12167e2fdf0 /sal | |
parent | 458c60950330daaf1c42d5edd3ac4a80fb321fdb (diff) |
coverity#1415617 Resource leak
Change-Id: Ib23bbd9403f44fd7aa3635a3febb6533b1f9edad
Diffstat (limited to 'sal')
-rw-r--r-- | sal/qa/osl/pipe/osl_Pipe.cxx | 8 |
1 files changed, 4 insertions, 4 deletions
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) |