registry: honour the WERROR that regsubkey_ctr_addkey gives us in reg_load_tree.
authorMichael Adam <obnox@samba.org>
Sun, 13 Apr 2008 13:45:33 +0000 (15:45 +0200)
committerMichael Adam <obnox@samba.org>
Sun, 13 Apr 2008 13:45:33 +0000 (15:45 +0200)
Michael
(This used to be commit c2d9baa29edb2356f32ca19aea828184e9ac7b93)

source3/registry/reg_api.c

index cbbc7dd0ef6fa0c514b3cc909b8eb8022a9c7be7..e9a71452556fb198ef1b7eb7001b91481beafb34 100644 (file)
@@ -771,7 +771,11 @@ static WERROR reg_load_tree(REGF_FILE *regfile, const char *topkeypath,
 
        key->subkey_index = 0;
        while ((subkey = regfio_fetch_subkey( regfile, key ))) {
-               regsubkey_ctr_addkey(subkeys, subkey->keyname);
+               result = regsubkey_ctr_addkey(subkeys, subkey->keyname);
+               if (!W_ERROR_IS_OK(result)) {
+                       TALLOC_FREE(subkeys);
+                       return result;
+               }
        }
 
        /* write this key and values out */