Author: jra Date: 2005-09-02 19:58:48 +0000 (Fri, 02 Sep 2005) New Revision: 9970
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=9970 Log: Sync with HEAD. Jeremy. Modified: branches/tmp/RPCREWRITE/source/registry/reg_db.c branches/tmp/RPCREWRITE/source/registry/regfio.c branches/tmp/RPCREWRITE/source/rpc_server/srv_svcctl_nt.c Changeset: Modified: branches/tmp/RPCREWRITE/source/registry/reg_db.c =================================================================== --- branches/tmp/RPCREWRITE/source/registry/reg_db.c 2005-09-02 19:57:22 UTC (rev 9969) +++ branches/tmp/RPCREWRITE/source/registry/reg_db.c 2005-09-02 19:58:48 UTC (rev 9970) @@ -92,18 +92,10 @@ fstring keyname, subkeyname; REGSUBKEY_CTR *subkeys; REGVAL_CTR *values; - uint32 *ctx; int i; const char *p, *p2; UNISTR2 data; - /* create a new top level talloc ctx */ - - if ( !(ctx = TALLOC_P( NULL, uint32 )) ) { - DEBUG(0,("init_registry_data: top level talloc() failure!\n")); - return False; - } - /* loop over all of the predefined paths and add each component */ for ( i=0; builtin_registry_paths[i] != NULL; i++ ) { @@ -140,7 +132,7 @@ we are about to update the record. We just want any subkeys already present */ - if ( !(subkeys = TALLOC_ZERO_P( ctx, REGSUBKEY_CTR )) ) { + if ( !(subkeys = TALLOC_ZERO_P( NULL, REGSUBKEY_CTR )) ) { DEBUG(0,("talloc() failure!\n")); return False; } @@ -158,7 +150,7 @@ /* loop over all of the predefined values and add each component */ for ( i=0; builtin_registry_values[i].path != NULL; i++ ) { - if ( !(values = TALLOC_ZERO_P( ctx, REGVAL_CTR )) ) { + if ( !(values = TALLOC_ZERO_P( NULL, REGVAL_CTR )) ) { DEBUG(0,("talloc() failure!\n")); return False; } Modified: branches/tmp/RPCREWRITE/source/registry/regfio.c =================================================================== --- branches/tmp/RPCREWRITE/source/registry/regfio.c 2005-09-02 19:57:22 UTC (rev 9969) +++ branches/tmp/RPCREWRITE/source/registry/regfio.c 2005-09-02 19:58:48 UTC (rev 9970) @@ -85,7 +85,7 @@ if ( (size_t)file_offset >= sbuf.st_size ) return -1; - /* if block_size == 0, we are parsnig HBIN records and need + /* if block_size == 0, we are parsing HBIN records and need to read some of the header to get the block_size from there */ if ( block_size == 0 ) { @@ -533,7 +533,7 @@ } /******************************************************************* - Input a randon offset and receive the correpsonding HBIN + Input a random offset and receive the corresponding HBIN block for it *******************************************************************/ @@ -549,7 +549,7 @@ } /******************************************************************* - Input a randon offset and receive the correpsonding HBIN + Input a random offset and receive the corresponding HBIN block for it *******************************************************************/ @@ -1030,7 +1030,7 @@ if ( curr_off == 0 ) prs_set_offset( ps, HBIN_HEADER_REC_SIZE ); - /* assume that the current offset is at the reacord header + /* assume that the current offset is at the record header and we need to backup to read the record size */ curr_off -= sizeof(uint32); Modified: branches/tmp/RPCREWRITE/source/rpc_server/srv_svcctl_nt.c =================================================================== --- branches/tmp/RPCREWRITE/source/rpc_server/srv_svcctl_nt.c 2005-09-02 19:57:22 UTC (rev 9969) +++ branches/tmp/RPCREWRITE/source/rpc_server/srv_svcctl_nt.c 2005-09-02 19:58:48 UTC (rev 9970) @@ -142,10 +142,7 @@ static void free_service_handle_info(void *ptr) { - SERVICE_INFO *info = (SERVICE_INFO*)ptr; - - SAFE_FREE(info->name); - SAFE_FREE(info); + TALLOC_FREE( ptr ); } /****************************************************************** @@ -173,11 +170,9 @@ SERVICE_INFO *info = NULL; WERROR result = WERR_OK; - if ( !(info = SMB_MALLOC_P( SERVICE_INFO )) ) + if ( !(info = TALLOC_ZERO_P( NULL, SERVICE_INFO )) ) return WERR_NOMEM; - ZERO_STRUCTP( info ); - /* the Service Manager has a NULL name */ if ( !service ) { @@ -201,7 +196,7 @@ goto done; } - if ( !(info->name = SMB_STRDUP( service )) ) { + if ( !(info->name = talloc_strdup( info, service )) ) { result = WERR_NOMEM; goto done; }
