1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-10-28 03:27:58 +03:00

Release allocated memory on closedown

Release allocated buffers before exit() in debug singlenode - so it's not
poping out in valgrind as memory leak.
This commit is contained in:
Zdenek Kabelac 2011-03-24 10:45:00 +00:00
parent 129526b826
commit dc4150e018

View File

@ -28,6 +28,8 @@
static const char SINGLENODE_CLVMD_SOCKNAME[] = DEFAULT_RUN_DIR "/clvmd_singlenode.sock";
static int listen_fd = -1;
static int *_locks = NULL;
static char **_resources = NULL;
static void close_comms(void)
{
@ -97,6 +99,10 @@ static void _cluster_closedown(void)
DEBUGLOG("cluster_closedown\n");
destroy_lvhash();
dm_free(_locks);
dm_free(_resources);
_locks = NULL;
_resources = NULL;
}
static void _get_our_csid(char *csid)
@ -136,8 +142,6 @@ static int _cluster_do_node_callback(struct local_client *master_client,
int _lock_file(const char *file, uint32_t flags);
static int *_locks = NULL;
static char **_resources = NULL;
static int _lock_max = 1;
static pthread_mutex_t _lock_mutex = PTHREAD_MUTEX_INITIALIZER;