Fix a bug in vk description parsing helper.

Fix a path with default kernel key type assumed.
It did not check correctly for return value from
asprintf and would leak the allocated memory
instead.
This commit is contained in:
Ondrej Kozina
2023-10-03 13:52:22 +02:00
parent 0236b82802
commit a5e2a97b53

View File

@@ -1635,7 +1635,7 @@ static int parse_vk_description(const char *key_description, char **ret_key_desc
r = tmp ? 0 : -ENOMEM;
}
if (!r)
if (r >= 0)
*ret_key_description = tmp;
return r;