From 3a4f4d3609afd3f0d2aa5601faf6ccbcd62589b5 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Fri, 2 Sep 2005 19:45:22 +0000 Subject: [PATCH] r9966: moving ServiceInfo structure to talloc()'d based --- source/rpc_server/srv_svcctl_nt.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/source/rpc_server/srv_svcctl_nt.c b/source/rpc_server/srv_svcctl_nt.c index 2e44dc36922..8ae894f2b17 100644 --- a/source/rpc_server/srv_svcctl_nt.c +++ b/source/rpc_server/srv_svcctl_nt.c @@ -142,10 +142,7 @@ static SEC_DESC* construct_service_sd( TALLOC_CTX *ctx ) 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 @@ static WERROR create_open_service_handle( pipes_struct *p, POLICY_HND *handle, 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 @@ static WERROR create_open_service_handle( pipes_struct *p, POLICY_HND *handle, goto done; } - if ( !(info->name = SMB_STRDUP( service )) ) { + if ( !(info->name = talloc_strdup( info, service )) ) { result = WERR_NOMEM; goto done; } -- 2.11.4.GIT