From 460c19df621d35260caceec7f598da1566263cd4 Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Sat, 8 Mar 2014 23:16:31 +0100 Subject: [PATCH] clvmd: fix memleak on exit This patch will releases allocated private resources from startup. Needs previous dm_zalloc patch to ensure unset private pointer is NULL. TODO: check on real cluster. --- WHATS_NEW | 1 + daemons/clvmd/clvmd.c | 1 + 2 files changed, 2 insertions(+) diff --git a/WHATS_NEW b/WHATS_NEW index 379117c3c..7d6f4d650 100644 --- a/WHATS_NEW +++ b/WHATS_NEW @@ -1,5 +1,6 @@ Version 2.02.106 - ==================================== + Cleanup all client resources on clvmd exit. Use dm_zalloc to clear members of clvmd client struct. Use BLKID_CFLAGS when compiling with blkid support. Use correct rl_completion_func_t typedef for new readline. diff --git a/daemons/clvmd/clvmd.c b/daemons/clvmd/clvmd.c index 3d9bce785..e8375a8c9 100644 --- a/daemons/clvmd/clvmd.c +++ b/daemons/clvmd/clvmd.c @@ -633,6 +633,7 @@ int main(int argc, char *argv[]) * break of 'clvmd' may access already free memory here. */ safe_close(&(delfd->fd)); + cmd_client_cleanup(delfd); dm_free(delfd); }