From c663c0055a473830071b3774e2f6f7e9f56984a3 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Thu, 13 Dec 2007 22:20:58 +0100 Subject: Cut down memory usage of registry initialization (This used to be commit 264d5dfe9fe97db0b69d7cd04086ad8ed9f78e74) --- source3/registry/reg_frontend.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'source3/registry/reg_frontend.c') diff --git a/source3/registry/reg_frontend.c b/source3/registry/reg_frontend.c index 577df1c3d4..40d9192b08 100644 --- a/source3/registry/reg_frontend.c +++ b/source3/registry/reg_frontend.c @@ -51,11 +51,13 @@ REGISTRY_HOOK reg_hooks[] = { bool init_registry( void ) { int i; + bool ret = false; + TALLOC_CTX *frame = talloc_stackframe(); if ( !regdb_init() ) { DEBUG(0,("init_registry: failed to initialize the registry tdb!\n")); - return False; + goto fail; } /* build the cache tree of registry hooks */ @@ -64,7 +66,7 @@ bool init_registry( void ) for ( i=0; reg_hooks[i].keyname; i++ ) { if ( !reghook_cache_add(®_hooks[i]) ) - return False; + goto fail; } if ( DEBUGLEVEL >= 20 ) @@ -80,7 +82,10 @@ bool init_registry( void ) regdb_close(); - return True; + ret = true; + fail: + TALLOC_FREE(frame); + return ret; } WERROR regkey_open_internal( TALLOC_CTX *ctx, REGISTRY_KEY **regkey, -- cgit