1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

commands: fix memleak

Keep all allocations 'mempool' allocated for simple cleanup.
This commit is contained in:
Zdenek Kabelac 2017-02-18 18:49:19 +01:00
parent 87c89ac279
commit 2a21a19d90

View File

@ -2519,7 +2519,7 @@ int lvm_run_command(struct cmd_context *cmd, int argc, char **argv)
/* each command should start out with sigint flag cleared */ /* each command should start out with sigint flag cleared */
sigint_clear(); sigint_clear();
cmd->name = strdup(argv[0]); cmd->name = dm_pool_strdup(cmd->mem, argv[0]);
/* eliminate '-' from all options starting with -- */ /* eliminate '-' from all options starting with -- */
for (i = 1; i < argc; i++) { for (i = 1; i < argc; i++) {