From: Michael Adam Date: Tue, 24 Feb 2009 22:28:48 +0000 (+0100) Subject: s3:registry: use regsubkey_ctr_init() in reg_eventlog.c X-Git-Tag: build_3.3.2_ctdb_1~36 X-Git-Url: http://git.samba.org/?a=commitdiff_plain;h=86717ebd7ba35cc2ae11c5419cb9bd81aa999e61;p=obnox%2Fsamba-ctdb.git s3:registry: use regsubkey_ctr_init() in reg_eventlog.c Michael Signed-off-by: Michael Adam --- diff --git a/source/registry/reg_eventlog.c b/source/registry/reg_eventlog.c index 5617f212eb..c02318beac 100644 --- a/source/registry/reg_eventlog.c +++ b/source/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; }