s3:net rpc registry: use regval_ctr_init() instead of direct allocation
authorMichael Adam <obnox@samba.org>
Mon, 24 May 2010 13:10:48 +0000 (15:10 +0200)
committerMichael Adam <obnox@samba.org>
Tue, 25 May 2010 08:35:31 +0000 (10:35 +0200)
source3/utils/net_rpc_registry.c

index c7224f7ecc9913220170e9f7c3afc273261aa6c7..db2e8d62057d34c30ef0740885ef8dee74f78714 100644 (file)
@@ -1038,7 +1038,8 @@ static bool write_registry_tree( REGF_FILE *infile, REGF_NK_REC *nk,
                return false;
        }
 
-       if ( !(values = TALLOC_ZERO_P( subkeys, struct regval_ctr )) ) {
+       werr = regval_ctr_init(subkeys, &values);
+       if (!W_ERROR_IS_OK(werr)) {
                DEBUG(0,("write_registry_tree: talloc() failed!\n"));
                TALLOC_FREE(subkeys);
                return false;