1
0
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:
Zdenek Kabelac 2012-10-12 16:50:38 +02:00
parent 4d7a4554f4
commit ee7143cd02
3 changed files with 14 additions and 0 deletions

6
lib/cache/lvmetad.c vendored
View File

@ -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
View File

@ -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

View File

@ -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();