summaryrefslogtreecommitdiffstats
path: root/daemons/lvmetad/lvmetad-core.c
diff options
context:
space:
mode:
authorPetr Rockai <prockai@redhat.com>2011-07-20 18:24:49 +0000
committerPetr Rockai <prockai@redhat.com>2011-07-20 18:24:49 +0000
commit652e0757c91347899aa2d0f81d2bbf2b62011e15 (patch)
tree52bb9dc898aeb66c9f14c05c092a0501a2c736c3 /daemons/lvmetad/lvmetad-core.c
parenta720420466463378aa08afa64dba793b9f3ef54d (diff)
downloadlvm2-652e0757c91347899aa2d0f81d2bbf2b62011e15.tar.gz
lvm2-652e0757c91347899aa2d0f81d2bbf2b62011e15.tar.xz
lvm2-652e0757c91347899aa2d0f81d2bbf2b62011e15.zip
Free up allocated memory before exiting, in lvmetad.
Diffstat (limited to 'daemons/lvmetad/lvmetad-core.c')
-rw-r--r--daemons/lvmetad/lvmetad-core.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/daemons/lvmetad/lvmetad-core.c b/daemons/lvmetad/lvmetad-core.c
index 3dccbaed..5940b3f5 100644
--- a/daemons/lvmetad/lvmetad-core.c
+++ b/daemons/lvmetad/lvmetad-core.c
@@ -274,6 +274,13 @@ static int init(daemon_state *s)
static int fini(daemon_state *s)
{
lvmetad_state *ls = s->private;
+ struct dm_hash_node *n = dm_hash_get_first(ls->vgs);
+ while (n) {
+ destroy_config_tree(dm_hash_get_data(ls->vgs, n));
+ n = dm_hash_get_next(ls->vgs, n);
+ }
+ dm_hash_destroy(ls->pvs);
+ dm_hash_destroy(ls->vgs);
return 1;
}