From 89f6f464eab10ae41b022a77dbfa01cdfde23c4e Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Wed, 10 Oct 2007 13:50:21 +0200 Subject: r25611: Smaller fix for winreg test. Guenther (This used to be commit e9e6ee4f73c5ed88cbf4585aa7e1a40e06cc131f) --- source4/torture/rpc/winreg.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'source4/torture/rpc/winreg.c') diff --git a/source4/torture/rpc/winreg.c b/source4/torture/rpc/winreg.c index e85ebb3e05..0a1c0a7bad 100644 --- a/source4/torture/rpc/winreg.c +++ b/source4/torture/rpc/winreg.c @@ -181,7 +181,7 @@ static bool test_GetKeySecurity(struct dcerpc_pipe *p, struct security_descriptor **sd_out) { struct winreg_GetKeySecurity r; - struct security_descriptor *sd; + struct security_descriptor *sd = NULL; DATA_BLOB sdblob; ZERO_STRUCT(r); @@ -200,6 +200,8 @@ static bool test_GetKeySecurity(struct dcerpc_pipe *p, sdblob.data = r.out.sd->data; sdblob.length = r.out.sd->len; + sd = talloc_zero(tctx, struct security_descriptor); + torture_assert_ntstatus_ok(tctx, ndr_pull_struct_blob(&sdblob, tctx, sd, (ndr_pull_flags_fn_t)ndr_pull_security_descriptor), @@ -211,6 +213,8 @@ static bool test_GetKeySecurity(struct dcerpc_pipe *p, if (sd_out) { *sd_out = sd; + } else { + talloc_free(sd); } return true; -- cgit