s3:registry: untangle assignments from checks in reg_createkey() (cherry picked from...
[samba.git] / source3 / registry / reg_api.c
index 2eced2698b829ce301b8079588672b6282057f22..b8d8f2cc29f6873fbf682626f6f880b7eef9850d 100644 (file)
@@ -568,9 +568,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;
        }