summaryrefslogtreecommitdiff
path: root/source3/services
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2010-05-24 14:03:46 +0200
committerMichael Adam <obnox@samba.org>2010-05-25 10:35:29 +0200
commit1be8f5fba4d5059a43732e2ad65ab269132bd205 (patch)
tree453e887d2299ea3693935ab38ffd51fe626ed701 /source3/services
parent53ba74ecee5ac0cb75f51f3af9f0c62119ed5367 (diff)
downloadsamba-1be8f5fba4d5059a43732e2ad65ab269132bd205.tar.gz
samba-1be8f5fba4d5059a43732e2ad65ab269132bd205.tar.bz2
samba-1be8f5fba4d5059a43732e2ad65ab269132bd205.zip
s3:services_db: use regval_ctr_init() instead of direct allocation
Diffstat (limited to 'source3/services')
-rw-r--r--source3/services/services_db.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/source3/services/services_db.c b/source3/services/services_db.c
index ba5b6a91e1..aa99ac9fef 100644
--- a/source3/services/services_db.c
+++ b/source3/services/services_db.c
@@ -376,7 +376,8 @@ static void add_new_svc_name(struct registry_key_handle *key_parent,
/* now for the service values */
- if ( !(values = TALLOC_ZERO_P( key_service, struct regval_ctr )) ) {
+ wresult = regval_ctr_init(key_service, &values);
+ if (!W_ERROR_IS_OK(wresult)) {
DEBUG(0,("add_new_svc_name: talloc() failed!\n"));
TALLOC_FREE( key_service );
return;
@@ -405,7 +406,8 @@ static void add_new_svc_name(struct registry_key_handle *key_parent,
}
SAFE_FREE(path);
- if ( !(values = TALLOC_ZERO_P( key_secdesc, struct regval_ctr )) ) {
+ wresult = regval_ctr_init(key_secdesc, &values);
+ if (!W_ERROR_IS_OK(wresult)) {
DEBUG(0,("add_new_svc_name: talloc() failed!\n"));
TALLOC_FREE( key_secdesc );
return;
@@ -522,7 +524,8 @@ struct security_descriptor *svcctl_get_secdesc( TALLOC_CTX *ctx, const char *nam
goto done;
}
- if ( !(values = TALLOC_ZERO_P( key, struct regval_ctr )) ) {
+ wresult = regval_ctr_init(key, &values);
+ if (!W_ERROR_IS_OK(wresult)) {
DEBUG(0,("svcctl_get_secdesc: talloc() failed!\n"));
goto done;
}
@@ -585,7 +588,8 @@ bool svcctl_set_secdesc( TALLOC_CTX *ctx, const char *name, struct security_desc
}
SAFE_FREE(path);
- if ( !(values = TALLOC_ZERO_P( key, struct regval_ctr )) ) {
+ wresult = regval_ctr_init(key, &values);
+ if (!W_ERROR_IS_OK(wresult)) {
DEBUG(0,("svcctl_set_secdesc: talloc() failed!\n"));
TALLOC_FREE( key );
return False;
@@ -638,7 +642,8 @@ const char *svcctl_lookup_dispname(TALLOC_CTX *ctx, const char *name, NT_USER_TO
}
SAFE_FREE(path);
- if ( !(values = TALLOC_ZERO_P( key, struct regval_ctr )) ) {
+ wresult = regval_ctr_init(key, &values);
+ if (!W_ERROR_IS_OK(wresult)) {
DEBUG(0,("svcctl_lookup_dispname: talloc() failed!\n"));
TALLOC_FREE( key );
goto fail;
@@ -690,7 +695,8 @@ const char *svcctl_lookup_description(TALLOC_CTX *ctx, const char *name, NT_USER
}
SAFE_FREE(path);
- if ( !(values = TALLOC_ZERO_P( key, struct regval_ctr )) ) {
+ wresult = regval_ctr_init(key, &values);
+ if (!W_ERROR_IS_OK(wresult)) {
DEBUG(0,("svcctl_lookup_description: talloc() failed!\n"));
TALLOC_FREE( key );
return NULL;
@@ -737,7 +743,8 @@ struct regval_ctr *svcctl_fetch_regvalues(const char *name, NT_USER_TOKEN *token
}
SAFE_FREE(path);
- if ( !(values = TALLOC_ZERO_P( NULL, struct regval_ctr )) ) {
+ wresult = regval_ctr_init(NULL, &values);
+ if (!W_ERROR_IS_OK(wresult)) {
DEBUG(0,("svcctl_fetch_regvalues: talloc() failed!\n"));
TALLOC_FREE( key );
return NULL;