]> sourceware.org Git - lvm2.git/commitdiff
Add missing vg_release to pvs and pvdisplay to fix memory leak.
authorMilan Broz <mbroz@redhat.com>
Tue, 24 Nov 2009 17:07:09 +0000 (17:07 +0000)
committerMilan Broz <mbroz@redhat.com>
Tue, 24 Nov 2009 17:07:09 +0000 (17:07 +0000)
WHATS_NEW
tools/pvdisplay.c
tools/reporter.c

index 7a94f5286d57ac66e8b57e2586c497d68deb0f7d..785939593070b04355527495eff968b39f04099a 100644 (file)
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
 Version 2.02.56 - 
 ====================================
+  Add missing vg_release to pvs and pvdisplay to fix memory leak.
   Do not try to unlock VG which is not locked in _process_one_vg.
   Move persistent filter dump to more appropriate place.
   Refresh device filters before full device rescan in lvmcache.
index 531f37a7957d57d1ef59dc2016b8cd69d7942a3f..47def172a051bb6648c3c018e341176f9f693c0b 100644 (file)
@@ -31,10 +31,11 @@ static int _pvdisplay_single(struct cmd_context *cmd,
                vg_name = pv_vg_name(pv);
                vg = vg_read(cmd, vg_name, (char *)&pv->vgid, 0);
                if (vg_read_error(vg)) {
-                       log_error("Skipping volume group %s", vg_name);
+                       log_error("Skipping volume group %s", vg_name);
+                       vg_release(vg);
                        /* FIXME If CLUSTERED should return ECMD_PROCESSED here */
-                       return ECMD_FAILED;
-               }
+                       return ECMD_FAILED;
+               }
 
                /*
                 * Replace possibly incomplete PV structure with new one
index 056e7118001fe1be267059be0a48be9e70d6343f..a552e2e9c116e31c3590e99765a64cf66d4f21e9 100644 (file)
@@ -143,6 +143,7 @@ static int _pvs_single(struct cmd_context *cmd, struct volume_group *vg,
                vg = vg_read(cmd, vg_name, (char *)&pv->vgid, 0);
                if (vg_read_error(vg)) {
                        log_error("Skipping volume group %s", vg_name);
+                       vg_release(vg);
                        return ECMD_FAILED;
                }
 
This page took 0.096686 seconds and 5 git commands to generate.