s3:profiles: use regsubkey_ctr_init() instead of using talloc directly.
authorMichael Adam <obnox@samba.org>
Tue, 24 Feb 2009 23:32:21 +0000 (00:32 +0100)
committerMichael Adam <obnox@samba.org>
Thu, 19 Mar 2009 17:03:58 +0000 (18:03 +0100)
Michael

Signed-off-by: Michael Adam <obnox@samba.org>
source/utils/profiles.c

index 2c9bc36fafaedb5d7ca052a2d2e61067406f69db..0ac93dedeb8beb6a0c9caf49353489bcc91466e1 100644 (file)
@@ -121,6 +121,7 @@ static bool copy_registry_tree( REGF_FILE *infile, REGF_NK_REC *nk,
        struct regsubkey_ctr *subkeys;
        int i;
        char *path;
+       WERROR werr;
 
        /* swap out the SIDs in the security descriptor */
 
@@ -132,7 +133,8 @@ static bool copy_registry_tree( REGF_FILE *infile, REGF_NK_REC *nk,
        verbose_output("ACL for %s%s%s\n", parentpath, parent ? "\\" : "", nk->keyname);
        swap_sid_in_acl( new_sd, &old_sid, &new_sid );
 
-       if ( !(subkeys = TALLOC_ZERO_P( NULL, struct regsubkey_ctr )) ) {
+       werr = regsubkey_ctr_init(NULL, &subkeys);
+       if (!W_ERROR_IS_OK(werr)) {
                DEBUG(0,("copy_registry_tree: talloc() failure!\n"));
                return False;
        }