s3:registry: untangle assignments from checks in reg_createkey()
authorMichael Adam <obnox@samba.org>
Thu, 12 Apr 2012 15:58:26 +0000 (17:58 +0200)
committerAndreas Schneider <asn@samba.org>
Wed, 25 Apr 2012 12:31:10 +0000 (14:31 +0200)
Signed-off-by: Andreas Schneider <asn@samba.org>
source3/registry/reg_api.c

index 0bffbda50293f284e71ac99ed0b98107ee7927a4..3d051b3f2dd5503482783afaec25a799bde6b41b 100644 (file)
@@ -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;
        }