mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
Make destroy_toolcontext() better able to handle NULL pointers.
Part of twoerner's log_error() patches. Signed-off-by: Thomas Woerner <twoerner@redhat.com> Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
This commit is contained in:
parent
e5c935bd12
commit
71e41d9139
@ -1302,12 +1302,15 @@ void destroy_toolcontext(struct cmd_context *cmd)
|
|||||||
label_exit();
|
label_exit();
|
||||||
_destroy_segtypes(&cmd->segtypes);
|
_destroy_segtypes(&cmd->segtypes);
|
||||||
_destroy_formats(&cmd->formats);
|
_destroy_formats(&cmd->formats);
|
||||||
cmd->filter->destroy(cmd->filter);
|
if (cmd->filter)
|
||||||
dm_pool_destroy(cmd->mem);
|
cmd->filter->destroy(cmd->filter);
|
||||||
|
if (cmd->mem)
|
||||||
|
dm_pool_destroy(cmd->mem);
|
||||||
dev_cache_exit();
|
dev_cache_exit();
|
||||||
_destroy_tags(cmd);
|
_destroy_tags(cmd);
|
||||||
_destroy_tag_configs(cmd);
|
_destroy_tag_configs(cmd);
|
||||||
dm_pool_destroy(cmd->libmem);
|
if (cmd->libmem)
|
||||||
|
dm_pool_destroy(cmd->libmem);
|
||||||
dm_free(cmd);
|
dm_free(cmd);
|
||||||
|
|
||||||
release_log_memory();
|
release_log_memory();
|
||||||
|
Loading…
Reference in New Issue
Block a user