diff options
author | Volker Lendecke <vl@samba.org> | 2007-12-13 22:20:58 +0100 |
---|---|---|
committer | Volker Lendecke <vl@samba.org> | 2007-12-16 14:02:46 +0100 |
commit | c663c0055a473830071b3774e2f6f7e9f56984a3 (patch) | |
tree | e251847e4a9795df0f469c62b49caef9b5bf94e8 /source3/registry/reg_frontend.c | |
parent | dd4e99c9d7111fe1fab9b0a968c1321425f83429 (diff) | |
download | samba-c663c0055a473830071b3774e2f6f7e9f56984a3.tar.gz samba-c663c0055a473830071b3774e2f6f7e9f56984a3.tar.bz2 samba-c663c0055a473830071b3774e2f6f7e9f56984a3.zip |
Cut down memory usage of registry initialization
(This used to be commit 264d5dfe9fe97db0b69d7cd04086ad8ed9f78e74)
Diffstat (limited to 'source3/registry/reg_frontend.c')
-rw-r--r-- | source3/registry/reg_frontend.c | 11 |
1 files changed, 8 insertions, 3 deletions
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, |