Remove memory leak
authorHyunbin Lee <hyunbin.lee@samsung.com>
Wed, 10 Apr 2013 11:15:22 +0000 (20:15 +0900)
committerHyunbin Lee <hyunbin.lee@samsung.com>
Wed, 10 Apr 2013 11:16:37 +0000 (20:16 +0900)
Change-Id: I49a822e4ef56bd518c963e5cf15755ff8d952716
Signed-off-by: Hyunbin Lee <hyunbin.lee@samsung.com>
src/io/FIo_RegistryCore.cpp

index 5ca9166..4581a51 100644 (file)
@@ -1321,7 +1321,6 @@ _RegistryCore::GetEntryValue(int sectionIndex, int entryIndex, _RegValueType typ
 {
        _RegistrySection* pRegSection = null;
        _RegistryEntry* pRegEntry = null;
-       IEnumerator* pEntryEnum = null;
        result r = E_SUCCESS;
        int listSize = 0;
        int tmpEntryIndex = -1;
@@ -1351,7 +1350,7 @@ _RegistryCore::GetEntryValue(int sectionIndex, int entryIndex, _RegValueType typ
        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;