diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-09-25 16:39:51 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2014-09-25 17:48:12 +0200 |
commit | 81055f589fc2de92e37dbe29f59b5da80728b28a (patch) | |
tree | a1c5c43984991d5447310eb4a0fb080feecbec7b /registry | |
parent | 5a9a3da719b65c53980e85940595f17c2f84f3c2 (diff) |
coverity#705672 Resource leak
Change-Id: Ibeab8e1b64f3185eaca81a31bd131d11994386f3
Signed-off-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'registry')
-rw-r--r-- | registry/source/regimpl.cxx | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/registry/source/regimpl.cxx b/registry/source/regimpl.cxx index 7021f457a1f7..f043eef146f8 100644 --- a/registry/source/regimpl.cxx +++ b/registry/source/regimpl.cxx @@ -541,11 +541,11 @@ RegError ORegistry::destroyRegistry(const OUString& regName) if (!regName.isEmpty()) { - ORegistry* pReg = new ORegistry(); + std::unique_ptr<ORegistry> pReg(new ORegistry()); if (!pReg->initRegistry(regName, REG_READWRITE)) { - delete pReg; + pReg.reset(); OUString systemName; if ( FileBase::getSystemPathFromFileURL(regName, systemName) != FileBase::E_None ) |