1
0
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:
Tony Asleson 2013-04-16 10:42:03 +02:00 committed by Peter Rajnoha
parent 2e0740f7ef
commit 2ccb9eb861

View File

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