]> sourceware.org Git - lvm2.git/commitdiff
dumpconfig: fix memleak when using --mergedconfig
authorPeter Rajnoha <prajnoha@redhat.com>
Tue, 18 Mar 2014 10:04:21 +0000 (11:04 +0100)
committerPeter Rajnoha <prajnoha@redhat.com>
Tue, 18 Mar 2014 10:11:31 +0000 (11:11 +0100)
Check whether lvm dumpconfig --mergedconfig is used only
with --type current (where we're merging current config and
the config supplied on command line). With other types
the config was merged, but it was thrown away since we're
generating other type of config anyway. This lead to a memleak.

Error out if --mergedconfig is used with anything else than
--type current (or without specifying --type in which case
the --type current is used by default).

WHATS_NEW
tools/dumpconfig.c

index a20331be8360ce6aaefaf7885bd96f25e87926a1..de96f8a762fa7f3ebb841bbd78dbbe40749e6327 100644 (file)
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
 Version 2.02.106 - 
 ====================================
+  Don't allow --mergedconfig without --type current in dumpconfig. Fix memleak.
   Make global/lvdisplay_shows_full_device_path lvm.conf setting profilable.
   Make global/{units|si_unit_consistency|suffix} lvm.conf setting profilable.
   Validate minimal chunk size for snapshot COW volume in lvconvert.
index dd86733896345ada154e5d80df14ca10ca53a00b..d9aebd90b5d74276541e74e00f687d70dc54c446 100644 (file)
@@ -126,6 +126,9 @@ int dumpconfig(struct cmd_context *cmd, int argc, char **argv)
                                  "no effect with --type current");
                        return EINVALID_CMD_LINE;
                }
+       } else if (arg_count(cmd, mergedconfig_ARG)) {
+               log_error("--mergedconfig has no effect without --type current");
+               return EINVALID_CMD_LINE;
        }
 
        if (!_get_vsn(cmd, &tree_spec.version))
This page took 0.061438 seconds and 5 git commands to generate.