From 2ccb9eb861c3b65ffc1aac024425e2cc10950077 Mon Sep 17 00:00:00 2001 From: Tony Asleson Date: Tue, 16 Apr 2013 10:42:03 +0200 Subject: [PATCH] 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. --- lib/config/config.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/config/config.c b/lib/config/config.c index 009eb5f88..2c77f3076 100644 --- a/lib/config/config.c +++ b/lib/config/config.c @@ -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); } }