Skip to content

Commit

Permalink
modules/kvs: fix memory leak in namespace_create()
Browse files Browse the repository at this point in the history
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.

Fixes #1483
  • Loading branch information
garlick committed Apr 24, 2018
1 parent 9649a59 commit b9d616a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/modules/kvs/kvs.c
Original file line number Diff line number Diff line change
Expand Up @@ -2594,6 +2594,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:
Expand Down

0 comments on commit b9d616a

Please sign in to comment.