diff options
author | Caolán McNamara <caolanm@redhat.com> | 2017-07-24 12:16:35 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2017-07-24 12:22:35 +0100 |
commit | a43187d9075c6347412a2584d764145127779df8 (patch) | |
tree | 980880ab731a487669f79b3f400b8289d55656dc /sal/qa | |
parent | 74fc5b87ebfeac4efbd60894f617d05ce0c7e978 (diff) |
fix use after delete in osl::Pipe dtor
drop down the the c api so we can truly pass ownership of the handle to
xNoAcquirePipe
Change-Id: I12acbec81726ae4a451b501bea5492a5865c0cc4
Diffstat (limited to 'sal/qa')
-rw-r--r-- | sal/qa/osl/pipe/osl_Pipe.cxx | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sal/qa/osl/pipe/osl_Pipe.cxx b/sal/qa/osl/pipe/osl_Pipe.cxx index a2f20058b36e..8fd43226f0db 100644 --- a/sal/qa/osl/pipe/osl_Pipe.cxx +++ b/sal/qa/osl/pipe/osl_Pipe.cxx @@ -172,11 +172,12 @@ namespace osl_Pipe void ctors_no_acquire( ) { /// create a pipe. - std::unique_ptr<osl::Pipe> xPipe(new osl::Pipe(test::uniquePipeName(aTestPipeName), osl_Pipe_CREATE)); + OUString aPipeName(test::uniquePipeName(aTestPipeName)); + oslPipe handle(osl_createPipe(aPipeName.pData, osl_Pipe_CREATE, nullptr)); /// constructs a pipe reference without acquiring the handle. - std::unique_ptr<osl::Pipe> xNoAcquirePipe(new osl::Pipe(xPipe->getHandle(), SAL_NO_ACQUIRE)); + std::unique_ptr<osl::Pipe> xNoAcquirePipe(new osl::Pipe(handle, SAL_NO_ACQUIRE)); - StreamPipe aStreamPipe(xPipe->getHandle()); + StreamPipe aStreamPipe(handle); xNoAcquirePipe.reset(); int nRet = aStreamPipe.send("a", 1); |