1
0
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:
Dave Wysochanski 2009-07-08 18:12:08 +00:00
parent e5c935bd12
commit 71e41d9139

View File

@ -1302,12 +1302,15 @@ void destroy_toolcontext(struct cmd_context *cmd)
label_exit();
_destroy_segtypes(&cmd->segtypes);
_destroy_formats(&cmd->formats);
cmd->filter->destroy(cmd->filter);
dm_pool_destroy(cmd->mem);
if (cmd->filter)
cmd->filter->destroy(cmd->filter);
if (cmd->mem)
dm_pool_destroy(cmd->mem);
dev_cache_exit();
_destroy_tags(cmd);
_destroy_tag_configs(cmd);
dm_pool_destroy(cmd->libmem);
if (cmd->libmem)
dm_pool_destroy(cmd->libmem);
dm_free(cmd);
release_log_memory();