mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
lvmetead: release token
Release allocated memory when destroing toolcontext
This commit is contained in:
parent
4d7a4554f4
commit
ee7143cd02
6
lib/cache/lvmetad.c
vendored
6
lib/cache/lvmetad.c
vendored
@ -86,6 +86,12 @@ void lvmetad_set_token(const struct dm_config_value *filter)
|
||||
log_warn("WARNING: Failed to set lvmetad token. Out of memory?");
|
||||
}
|
||||
|
||||
void lvmetad_release_token(void)
|
||||
{
|
||||
dm_free(_lvmetad_token);
|
||||
_lvmetad_token = NULL;
|
||||
}
|
||||
|
||||
void lvmetad_set_socket(const char *sock)
|
||||
{
|
||||
_lvmetad_socket = sock;
|
||||
|
5
lib/cache/lvmetad.h
vendored
5
lib/cache/lvmetad.h
vendored
@ -63,6 +63,11 @@ void lvmetad_disconnect(void);
|
||||
*/
|
||||
void lvmetad_set_token(const struct dm_config_value *filter);
|
||||
|
||||
/*
|
||||
* Release allocated token.
|
||||
*/
|
||||
void lvmetad_release_token(void);
|
||||
|
||||
/*
|
||||
* Send a new version of VG metadata to lvmetad. This is normally called after
|
||||
* vg_write but before vg_commit. After vg_commit, lvmetad_vg_commit is called
|
||||
|
@ -1672,6 +1672,9 @@ void destroy_toolcontext(struct cmd_context *cmd)
|
||||
|
||||
dm_free(cmd);
|
||||
|
||||
lvmetad_release_token();
|
||||
lvmetad_disconnect();
|
||||
|
||||
release_log_memory();
|
||||
activation_exit();
|
||||
reset_log_duplicated();
|
||||
|
Loading…
Reference in New Issue
Block a user