mirror of
git://sourceware.org/git/lvm2.git
synced 2025-01-03 05:18:29 +03:00
coverity: fix possible NULL dereference
The call to dm_config_destroy can derefence result->mem while result is still NULL: struct dm_config_tree *get_cachepolicy_params(struct cmd_context *cmd) { ... int ok = 0; ... if (!(result = dm_config_flatten(current))) goto_out; ... ok = 1; out: if (!ok) { dm_config_destroy(result) ... } ... }
This commit is contained in:
parent
86ae68a5f7
commit
193f9b26a0
@ -1175,7 +1175,7 @@ struct dm_config_tree *get_cachepolicy_params(struct cmd_context *cmd)
|
|||||||
ok = 1;
|
ok = 1;
|
||||||
|
|
||||||
out:
|
out:
|
||||||
if (!ok) {
|
if (!ok && result) {
|
||||||
dm_config_destroy(result);
|
dm_config_destroy(result);
|
||||||
result = NULL;
|
result = NULL;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user