s3:registry: untangle assignments from checks in reg_createkey() (cherry picked from...
authorMichael Adam <obnox@samba.org>
Thu, 12 Apr 2012 15:58:26 +0000 (17:58 +0200)
committerKarolin Seeger <kseeger@samba.org>
Thu, 10 May 2012 09:15:23 +0000 (11:15 +0200)
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;
        }