From 1af68be008a11bffdf78d70c8d1635003a3c4407 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Thu, 12 Apr 2012 17:58:26 +0200 Subject: s3:registry: untangle assignments from checks in reg_createkey() Signed-off-by: Andreas Schneider --- source3/registry/reg_api.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'source3/registry') diff --git a/source3/registry/reg_api.c b/source3/registry/reg_api.c index 0bffbda502..3d051b3f2d 100644 --- a/source3/registry/reg_api.c +++ b/source3/registry/reg_api.c @@ -569,9 +569,13 @@ WERROR reg_createkey(TALLOC_CTX *ctx, struct registry_key *parent, char *path, *end; WERROR err; - if (!(mem_ctx = talloc_new(ctx))) return WERR_NOMEM; + mem_ctx = talloc_new(ctx); + if (mem_ctx == NULL) { + return WERR_NOMEM; + } - if (!(path = talloc_strdup(mem_ctx, subkeypath))) { + path = talloc_strdup(mem_ctx, subkeypath); + if (path == NULL) { err = WERR_NOMEM; goto done; } -- cgit