summaryrefslogtreecommitdiff
path: root/ucb
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-09-06 11:26:14 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-09-07 08:48:17 +0200
commit6c96bc3cbe109c97cddda9b357c1857fbcb4700c (patch)
treecd56601cdca8816124fa1ad8352b339dc24086f9 /ucb
parentcf67ffaacba130a0c572f26cbd14a7492d9b53b8 (diff)
loplugin:useuniqueptr in NeonSession
Change-Id: I8ff5c031ddd6cf6546c6e4eee60cbe9f60d4fb5f Reviewed-on: https://gerrit.libreoffice.org/60114 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'ucb')
-rw-r--r--ucb/source/ucp/webdav-neon/NeonSession.cxx8
1 files changed, 3 insertions, 5 deletions
diff --git a/ucb/source/ucp/webdav-neon/NeonSession.cxx b/ucb/source/ucp/webdav-neon/NeonSession.cxx
index 903ca27a7720..2d391f69ae06 100644
--- a/ucb/source/ucp/webdav-neon/NeonSession.cxx
+++ b/ucb/source/ucp/webdav-neon/NeonSession.cxx
@@ -1056,8 +1056,8 @@ void NeonSession::PROPPATCH( const OUString & inPath,
// Generate the list of properties we want to set.
int nPropCount = inValues.size();
- ne_proppatch_operation* pItems
- = new ne_proppatch_operation[ nPropCount + 1 ];
+ std::unique_ptr<ne_proppatch_operation[]> pItems(
+ new ne_proppatch_operation[ nPropCount + 1 ]);
for ( n = 0; n < nPropCount; ++n )
{
const ProppatchValue & rValue = inValues[ n ];
@@ -1136,7 +1136,7 @@ void NeonSession::PROPPATCH( const OUString & inPath,
theRetVal = ne_proppatch( m_pHttpSession,
OUStringToOString(
inPath, RTL_TEXTENCODING_UTF8 ).getStr(),
- pItems );
+ pItems.get() );
}
for ( n = 0; n < nPropCount; ++n )
@@ -1146,8 +1146,6 @@ void NeonSession::PROPPATCH( const OUString & inPath,
free( const_cast<char *>(pItems[ n ].value) );
}
- delete [] pItems;
-
HandleError( theRetVal, inPath, rEnv );
}