summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2009-07-09 00:21:46 +0200
committerMichael Adam <obnox@samba.org>2009-07-15 14:01:53 +0200
commitf93c9e0d415b5c2e2fd73bb370db7b7e17ede9aa (patch)
treeb27deb3d8be86b15295fff6827c4f54aa829e8b5
parent3eec829e2fa2106c8d52f31e3f3d7f45e6c81b24 (diff)
downloadsamba-f93c9e0d415b5c2e2fd73bb370db7b7e17ede9aa.tar.gz
samba-f93c9e0d415b5c2e2fd73bb370db7b7e17ede9aa.tar.bz2
samba-f93c9e0d415b5c2e2fd73bb370db7b7e17ede9aa.zip
s3:registry: don't leak to talloc_stack in regdb_store_keys_internal2()
and catch one potential talloc failure. Michael
-rw-r--r--source3/registry/reg_backend_db.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/source3/registry/reg_backend_db.c b/source3/registry/reg_backend_db.c
index 542f6dc7d0..6bf98d4c75 100644
--- a/source3/registry/reg_backend_db.c
+++ b/source3/registry/reg_backend_db.c
@@ -623,14 +623,21 @@ static WERROR regdb_store_keys_internal2(struct db_context *db,
WERROR werr;
if (!key) {
- return WERR_INVALID_PARAM;
+ werr = WERR_INVALID_PARAM;
+ goto done;
}
keyname = talloc_strdup(ctx, key);
if (!keyname) {
- return WERR_NOMEM;
+ werr = WERR_NOMEM;
+ goto done;
}
+
keyname = normalize_reg_path(ctx, keyname);
+ if (!keyname) {
+ werr = WERR_NOMEM;
+ goto done;
+ }
/* allocate some initial memory */