summaryrefslogtreecommitdiff
path: root/emfio
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2019-04-26 17:15:26 +0200
committerStephan Bergmann <sbergman@redhat.com>2019-04-26 22:09:31 +0200
commitb380c82491593d783ecd5469feda0220ec264db3 (patch)
tree8f8bd971418c22b429d8a3a10a5cdac7aabf57e2 /emfio
parent719d81a6c163356c93ea5d57ff8680bf4266a563 (diff)
Avoid manual malloc/free
Change-Id: I7420dfde91ab52316139b446ea5c5aac79ed2350 Reviewed-on: https://gerrit.libreoffice.org/71380 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'emfio')
-rw-r--r--emfio/source/reader/emfreader.cxx6
1 files changed, 3 insertions, 3 deletions
diff --git a/emfio/source/reader/emfreader.cxx b/emfio/source/reader/emfreader.cxx
index 574858ccd67d..51a8a6fb029b 100644
--- a/emfio/source/reader/emfreader.cxx
+++ b/emfio/source/reader/emfreader.cxx
@@ -406,9 +406,9 @@ namespace emfio
mbEMFPlus = true;
sal_uInt64 const pos = mpInputStream->Tell();
- void *buffer = malloc( length );
- PassEMFPlus( buffer, mpInputStream->ReadBytes(buffer, length) );
- free( buffer );
+ auto buffer = std::make_unique<char[]>( length );
+ PassEMFPlus( buffer.get(), mpInputStream->ReadBytes(buffer.get(), length) );
+ buffer.reset();
mpInputStream->Seek( pos );
bHaveDC = false;