{
_RegistrySection* pRegSection = null;
_RegistryEntry* pRegEntry = null;
- IEnumerator* pEntryEnum = null;
result r = E_SUCCESS;
int listSize = 0;
int tmpEntryIndex = -1;
SysTryReturnVoidResult(NID_IO, entryIndex < entryListSize, E_KEY_NOT_FOUND, "[E_KEY_NOT_FOUND]Entry not found.");
// read the entries for this section
- pEntryEnum = pRegSection->__entryList.GetEnumeratorN();
+ unique_ptr< IEnumerator > pEntryEnum(pRegSection->__entryList.GetEnumeratorN());
SysTryReturnVoidResult(NID_IO, pEntryEnum != null, E_OBJ_NOT_FOUND, "[E_OBJ_NOT_FOUND]Entry list is empty.");
tmpEntryIndex = entryIndex;