mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
config_def_check: fix memory leak
There is no need to strdup a key when inserting into the hash table as the table allocates memory and copies the string. This was causing memory to be lost.
This commit is contained in:
parent
2e0740f7ef
commit
2ccb9eb861
@ -577,7 +577,7 @@ int config_def_check(struct cmd_context *cmd, int force, int skip, int suppress_
|
||||
cmd->cft_def_hash = NULL;
|
||||
r = 0; goto out;
|
||||
}
|
||||
dm_hash_insert(cmd->cft_def_hash, dm_strdup(vp), def);
|
||||
dm_hash_insert(cmd->cft_def_hash, vp, def);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user