diff options
author | Matthias Dieter Wallnöfer <mwallnoefer@yahoo.de> | 2010-03-22 19:44:19 +0100 |
---|---|---|
committer | Matthias Dieter Wallnöfer <mwallnoefer@yahoo.de> | 2010-03-22 22:31:02 +0100 |
commit | 05d8882a966708f994688fce3b978abb1432bc40 (patch) | |
tree | c5d5049571efa45701bfb46679536989bac963cb /source4/lib | |
parent | 96bb09bcf6ed221b1ce11dd4ec91b64d53ff6626 (diff) | |
download | samba-05d8882a966708f994688fce3b978abb1432bc40.tar.gz samba-05d8882a966708f994688fce3b978abb1432bc40.tar.bz2 samba-05d8882a966708f994688fce3b978abb1432bc40.zip |
s4:registry - "util" - fix up memory allocated data
Diffstat (limited to 'source4/lib')
-rw-r--r-- | source4/lib/registry/util.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/source4/lib/registry/util.c b/source4/lib/registry/util.c index 8aff578cd9..2ebb86b147 100644 --- a/source4/lib/registry/util.c +++ b/source4/lib/registry/util.c @@ -192,6 +192,7 @@ WERROR reg_open_key_abs(TALLOC_CTX *mem_ctx, struct registry_context *handle, predeflength = strlen(name); predefname = talloc_strndup(mem_ctx, name, predeflength); + W_ERROR_HAVE_NO_MEMORY(predefname); error = reg_get_predefined_key_by_name(handle, predefname, &predef); talloc_free(predefname); @@ -220,13 +221,15 @@ static WERROR get_abs_parent(TALLOC_CTX *mem_ctx, struct registry_context *ctx, } parent_name = talloc_strndup(mem_ctx, path, strrchr(path, '\\')-path); - + W_ERROR_HAVE_NO_MEMORY(parent_name); error = reg_open_key_abs(mem_ctx, ctx, parent_name, parent); + talloc_free(parent_name); if (!W_ERROR_IS_OK(error)) { return error; } *name = talloc_strdup(mem_ctx, strrchr(path, '\\')+1); + W_ERROR_HAVE_NO_MEMORY(*name); return WERR_OK; } @@ -249,6 +252,9 @@ WERROR reg_key_del_abs(struct registry_context *ctx, const char *path) talloc_free(mem_ctx); + talloc_free(parent); + talloc_free(n); + return error; } @@ -274,5 +280,8 @@ WERROR reg_key_add_abs(TALLOC_CTX *mem_ctx, struct registry_context *ctx, error = reg_key_add_name(mem_ctx, parent, n, NULL, sec_desc, result); + talloc_free(parent); + talloc_free(n); + return error; } |