param: Use an explicit talloc_stackframe() in lp_load_ex for clarity and certainty
authorAndrew Bartlett <abartlet@samba.org>
Tue, 1 Apr 2014 03:27:58 +0000 (16:27 +1300)
committerJeremy Allison <jra@samba.org>
Wed, 7 May 2014 20:14:21 +0000 (22:14 +0200)
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed May  7 22:14:21 CEST 2014 on sn-devel-104

source3/param/loadparm.c

index 9c3119fb50038735e00c65daaabf3412b14c50c2..2ba2037a62926bbb3d1f792d7ebe75764418f769 100644 (file)
@@ -3974,6 +3974,7 @@ static bool lp_load_ex(const char *pszFname,
 {
        char *n2 = NULL;
        bool bRetval;
+       TALLOC_CTX *frame = talloc_stackframe();
 
        bRetval = false;
 
@@ -4024,6 +4025,7 @@ static bool lp_load_ex(const char *pszFname,
                }
 
                if (lp_config_backend_is_registry()) {
+                       bool ok;
                        /* config backend changed to registry in config file */
                        /*
                         * We need to use this extra global variable here to
@@ -4037,10 +4039,12 @@ static bool lp_load_ex(const char *pszFname,
                                  "registry\n"));
                        init_globals(true);
                        lp_kill_all_services();
-                       return lp_load_ex(pszFname, global_only, save_defaults,
-                                         add_ipc, initialize_globals,
-                                         allow_include_registry,
-                                         load_all_shares);
+                       ok = lp_load_ex(pszFname, global_only, save_defaults,
+                                       add_ipc, initialize_globals,
+                                       allow_include_registry,
+                                       load_all_shares);
+                       TALLOC_FREE(frame);
+                       return ok;
                }
        } else if (lp_config_backend_is_registry()) {
                bRetval = process_registry_globals();
@@ -4114,6 +4118,7 @@ static bool lp_load_ex(const char *pszFname,
 
        bAllowIncludeRegistry = true;
 
+       TALLOC_FREE(frame);
        return (bRetval);
 }