From 1ce0035abbff4625621c0ef16af3902959cd342f Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Tue, 24 Feb 2009 23:28:48 +0100 Subject: s3:registry: use regsubkey_ctr_init() in reg_eventlog.c Michael --- source3/registry/reg_eventlog.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'source3/registry/reg_eventlog.c') 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; } -- cgit