1
0
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:
Peter Rajnoha 2014-11-26 11:46:13 +01:00
parent 86ae68a5f7
commit 193f9b26a0

View File

@ -1175,7 +1175,7 @@ struct dm_config_tree *get_cachepolicy_params(struct cmd_context *cmd)
ok = 1;
out:
if (!ok) {
if (!ok && result) {
dm_config_destroy(result);
result = NULL;
}