cid#705674 and cid#705675 Resource leak

Change-Id: Id97e5de8433cc5dc9cb72c0d447ce6af50eb4918
This commit is contained in:
Noel Grandin 2014-07-18 14:01:12 +02:00
parent 0532c5a897
commit dac4af0e0f

View file

@ -514,6 +514,7 @@ REG_DLLPUBLIC RegError REGISTRY_CALLTYPE reg_createRegistry(rtl_uString* registr
ORegistry* pReg = new ORegistry(); ORegistry* pReg = new ORegistry();
if ((ret = pReg->initRegistry(registryName, REG_CREATE))) if ((ret = pReg->initRegistry(registryName, REG_CREATE)))
{ {
delete pReg;
*phRegistry = NULL; *phRegistry = NULL;
return ret; return ret;
} }
@ -563,6 +564,7 @@ REG_DLLPUBLIC RegError REGISTRY_CALLTYPE reg_openRegistry(rtl_uString* registryN
ORegistry* pReg = new ORegistry(); ORegistry* pReg = new ORegistry();
if ((_ret = pReg->initRegistry(registryName, accessMode))) if ((_ret = pReg->initRegistry(registryName, accessMode)))
{ {
delete pReg;
*phRegistry = NULL; *phRegistry = NULL;
return _ret; return _ret;
} }