s3-param: Make sure we have talloc stack frame before calling in s3 code
authorAmitay Isaacs <amitay@gmail.com>
Fri, 12 Aug 2011 05:40:26 +0000 (15:40 +1000)
committerAndrew Bartlett <abartlet@samba.org>
Sat, 13 Aug 2011 02:30:50 +0000 (12:30 +1000)
When loading parameters as s4 context in s3 code, ensure we have a
talloc stack frame. This is required for python wrapping s3 params.

source3/param/loadparm_ctx.c

index 2289f6bc29bb1b318baf4d26d9e9e84ef349852e..3aadda1bd080082f36a586eabdf4d1ddcfd3f77f 100644 (file)
 
 static bool lp_load_for_s4_ctx(const char *filename)
 {
-       return lp_load(filename, false, false, false, false);
+       TALLOC_CTX *mem_ctx;
+       bool status;
+
+       mem_ctx = talloc_stackframe();
+       status =  lp_load(filename, false, false, false, false);
+       talloc_free(mem_ctx);
+
+       return status;
 }
 
 /* These are in the order that they appear in the s4 loadparm file.