VMCache::Init(): Initialize the debug_* members before allocating the
VMCacheRef object, since that can fail, in which case the subsequently called Delete() would use uninitialized pointers. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35279 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -594,6 +594,12 @@ VMCache::Init(uint32 cacheType)
|
|||||||
type = cacheType;
|
type = cacheType;
|
||||||
fPageEventWaiters = NULL;
|
fPageEventWaiters = NULL;
|
||||||
|
|
||||||
|
#if DEBUG_CACHE_LIST
|
||||||
|
debug_previous = NULL;
|
||||||
|
debug_next = NULL;
|
||||||
|
// initialize in case the following fails
|
||||||
|
#endif
|
||||||
|
|
||||||
fCacheRef = new(nogrow) VMCacheRef(this);
|
fCacheRef = new(nogrow) VMCacheRef(this);
|
||||||
if (fCacheRef == NULL)
|
if (fCacheRef == NULL)
|
||||||
return B_NO_MEMORY;
|
return B_NO_MEMORY;
|
||||||
@@ -603,7 +609,6 @@ VMCache::Init(uint32 cacheType)
|
|||||||
|
|
||||||
if (gDebugCacheList)
|
if (gDebugCacheList)
|
||||||
gDebugCacheList->debug_previous = this;
|
gDebugCacheList->debug_previous = this;
|
||||||
debug_previous = NULL;
|
|
||||||
debug_next = gDebugCacheList;
|
debug_next = gDebugCacheList;
|
||||||
gDebugCacheList = this;
|
gDebugCacheList = this;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user