From cc44fe5338fbd5ea34488c17bb92e1f30f439774 Mon Sep 17 00:00:00 2001 From: Jim Garlick Date: Thu, 12 Apr 2018 12:29:03 -0700 Subject: [PATCH] modules/kvs: fix memory leak in namespace_create() Problem: valgrind test fails when private KVS namespace is made part of job setup. Looks like some memory allocated in namespace_create() that was freed in the error path, was not freed in the non-error path. Fix that. --- src/modules/kvs/kvs.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/modules/kvs/kvs.c b/src/modules/kvs/kvs.c index 593c824fb822..fbaeffe1dc70 100644 --- a/src/modules/kvs/kvs.c +++ b/src/modules/kvs/kvs.c @@ -2598,6 +2598,8 @@ static int namespace_create (kvs_ctx_t *ctx, const char *namespace, goto cleanup_remove_root; } + json_decref (rootdir); + free (data); return 0; cleanup_remove_root: