1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-02 01:18:26 +03:00

Release pools for regex if there is error during processing

(fixes error messages about unreleased pools).
This commit is contained in:
Zdenek Kabelac 2010-04-30 12:37:04 +00:00
parent 8889fda53d
commit 7147cd9fe5
2 changed files with 8 additions and 2 deletions

View File

@ -1,5 +1,6 @@
Version 2.02.64 -
=================================
Fix memory leak for invalid regex pattern input.
Display invalid regex pattern for filter configuration in case of error.
Remove no-longer-used arg_ptr_value.
Fix -M and --type to use strings not pointers that change on config refresh.

View File

@ -639,14 +639,14 @@ static struct dev_filter *_init_filter_components(struct cmd_context *cmd)
else if (!(filters[nr_filt++] = regex_filter_create(cn->v))) {
log_error("Failed to create regex device filter");
return NULL;
goto err;
}
/* device type filter. Required. */
cn = find_config_tree_node(cmd, "devices/types");
if (!(filters[nr_filt++] = lvm_type_filter_create(cmd->proc_dir, cn))) {
log_error("Failed to create lvm type filter");
return NULL;
goto err;
}
/* md component filter. Optional, non-critical. */
@ -660,6 +660,11 @@ static struct dev_filter *_init_filter_components(struct cmd_context *cmd)
/* Only build a composite filter if we really need it. */
return (nr_filt == 1) ?
filters[0] : composite_filter_create(nr_filt, filters);
err:
nr_filt--; /* skip NULL */
while (nr_filt-- > 0)
filters[nr_filt]->destroy(filters[nr_filt]);
return NULL;
}
static int _init_filters(struct cmd_context *cmd, unsigned load_persistent_cache)