summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2009-02-24 23:28:48 +0100
committerMichael Adam <obnox@samba.org>2009-02-26 13:22:53 +0100
commit1ce0035abbff4625621c0ef16af3902959cd342f (patch)
tree75d03dc59eec75b0010762bebc3c17c6b59b38d6 /source3
parentb384d0d49d1c3748c03e86f84ad7f1e4a6bc55b2 (diff)
downloadsamba-1ce0035abbff4625621c0ef16af3902959cd342f.tar.gz
samba-1ce0035abbff4625621c0ef16af3902959cd342f.tar.bz2
samba-1ce0035abbff4625621c0ef16af3902959cd342f.zip
s3:registry: use regsubkey_ctr_init() in reg_eventlog.c
Michael
Diffstat (limited to 'source3')
-rw-r--r--source3/registry/reg_eventlog.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/source3/registry/reg_eventlog.c b/source3/registry/reg_eventlog.c
index 5617f212eb..c02318beac 100644
--- a/source3/registry/reg_eventlog.c
+++ b/source3/registry/reg_eventlog.c
@@ -42,9 +42,11 @@ bool eventlog_init_keys(void)
uint32 uiCategoryCount;
UNISTR2 data;
TALLOC_CTX *ctx = talloc_tos();
+ WERROR werr;
while (elogs && *elogs) {
- if (!(subkeys = TALLOC_ZERO_P(ctx, struct regsubkey_ctr ) ) ) {
+ werr = regsubkey_ctr_init(ctx, &subkeys);
+ if (!W_ERROR_IS_OK(werr)) {
DEBUG( 0, ( "talloc() failure!\n" ) );
return False;
}
@@ -70,7 +72,8 @@ bool eventlog_init_keys(void)
DEBUG( 5,
( "Adding key of [%s] to path of [%s]\n", *elogs,
evtlogpath ) );
- if (!(subkeys = TALLOC_ZERO_P(ctx, struct regsubkey_ctr))) {
+ werr = regsubkey_ctr_init(ctx, &subkeys);
+ if (!W_ERROR_IS_OK(werr)) {
DEBUG( 0, ( "talloc() failure!\n" ) );
return False;
}
@@ -207,6 +210,7 @@ bool eventlog_add_source( const char *eventlog, const char *sourcename,
int i;
int numsources;
TALLOC_CTX *ctx = talloc_tos();
+ WERROR werr;
if (!elogs) {
return False;
@@ -315,7 +319,8 @@ bool eventlog_add_source( const char *eventlog, const char *sourcename,
TALLOC_FREE(values);
TALLOC_FREE(wrklist); /* */
- if ( !( subkeys = TALLOC_ZERO_P(ctx, struct regsubkey_ctr ) ) ) {
+ werr = regsubkey_ctr_init(ctx, &subkeys);
+ if (!W_ERROR_IS_OK(werr)) {
DEBUG( 0, ( "talloc() failure!\n" ) );
return False;
}
@@ -342,7 +347,8 @@ bool eventlog_add_source( const char *eventlog, const char *sourcename,
/* now allocate room for the source's subkeys */
- if ( !( subkeys = TALLOC_ZERO_P(ctx, struct regsubkey_ctr ) ) ) {
+ werr = regsubkey_ctr_init(ctx, &subkeys);
+ if (!W_ERROR_IS_OK(werr)) {
DEBUG( 0, ( "talloc() failure!\n" ) );
return False;
}