regedit: Check for a valid subkey pointer before attempting to delete a registry key (Coverity).

Signed-off-by: Hugh McMaster <hugh.mcmaster@outlook.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Hugh McMaster 2017-07-24 12:47:56 +00:00 committed by Alexandre Julliard
parent b501b2388d
commit 5bd636dc16

View file

@ -1125,7 +1125,7 @@ void delete_registry_key(WCHAR *reg_key_name)
error_exit(STRING_INVALID_SYSTEM_KEY, reg_key_name);
}
if (!*key_name)
if (!key_name || !*key_name)
error_exit(STRING_DELETE_FAILED, reg_key_name);
RegDeleteTreeW(key_class, key_name);