Fixed reg_unload: ignore empty root_key
(cherry picked from commit 327935dfaf
)
This commit is contained in:
parent
7f57ce1ac0
commit
0d227b5019
@ -459,17 +459,19 @@ static void reg_unload(Reg* reg)
|
||||
RegKey* pKey;
|
||||
|
||||
WINPR_ASSERT(reg);
|
||||
WINPR_ASSERT(reg->root_key);
|
||||
pKey = reg->root_key->subkeys;
|
||||
|
||||
while (pKey != NULL)
|
||||
if (reg->root_key)
|
||||
{
|
||||
RegKey* pKeyNext = pKey->next;
|
||||
reg_unload_key(reg, pKey);
|
||||
pKey = pKeyNext;
|
||||
}
|
||||
pKey = reg->root_key->subkeys;
|
||||
|
||||
free(reg->root_key);
|
||||
while (pKey != NULL)
|
||||
{
|
||||
RegKey* pKeyNext = pKey->next;
|
||||
reg_unload_key(reg, pKey);
|
||||
pKey = pKeyNext;
|
||||
}
|
||||
|
||||
free(reg->root_key);
|
||||
}
|
||||
}
|
||||
|
||||
Reg* reg_open(BOOL read_only)
|
||||
|
Loading…
Reference in New Issue
Block a user