Skip to content

Commit

Permalink
source4/torture: add talloc_stackframe()
Browse files Browse the repository at this point in the history
We need a stackframe to call lp_load().

Signed-off-by: Rusty Russell <[email protected]>

Autobuild-User(master): Rusty Russell <[email protected]>
Autobuild-Date(master): Wed Jul 18 09:31:07 CEST 2012 on sn-devel-104
  • Loading branch information
rustyrussell committed Jul 18, 2012
1 parent 06731bc commit 127352c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions source4/torture/libnetapi/libnetapi.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ bool torture_libnetapi_init_context(struct torture_context *tctx,
{
NET_API_STATUS status;
struct libnetapi_ctx *ctx;
TALLOC_CTX *frame = talloc_stackframe();

if (!lp_load(lpcfg_configfile(tctx->lp_ctx), true, false, false, true)) {
fprintf(stderr, "error loading %s\n", lpcfg_configfile(tctx->lp_ctx));
Expand All @@ -42,6 +43,7 @@ bool torture_libnetapi_init_context(struct torture_context *tctx,

status = libnetapi_net_init(&ctx);
if (status != 0) {
talloc_free(frame);
return false;
}

Expand All @@ -52,6 +54,7 @@ bool torture_libnetapi_init_context(struct torture_context *tctx,

*ctx_p = ctx;

talloc_free(frame);
return true;
}

Expand Down

0 comments on commit 127352c

Please sign in to comment.