diff options
Diffstat (limited to 'source4')
-rw-r--r-- | source4/torture/rpc/winreg.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/source4/torture/rpc/winreg.c b/source4/torture/rpc/winreg.c index 798a069558..404b90a1a9 100644 --- a/source4/torture/rpc/winreg.c +++ b/source4/torture/rpc/winreg.c @@ -329,8 +329,8 @@ static BOOL test_Cleanup(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, struct winreg_DeleteKey r; r.in.handle = handle; - init_winreg_String(&r.in.key, key); + init_winreg_String(&r.in.key, key); dcerpc_winreg_DeleteKey(p, mem_ctx, &r); return True; @@ -700,6 +700,8 @@ static BOOL test_Open(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, winreg_open_fn return False; } + test_Cleanup(p, mem_ctx, &handle, TEST_KEY1); + test_Cleanup(p, mem_ctx, &handle, TEST_KEY2); test_Cleanup(p, mem_ctx, &handle, TEST_KEY_BASE); if (!test_CreateKey(p, mem_ctx, &handle, TEST_KEY1, NULL)) { @@ -730,7 +732,8 @@ static BOOL test_Open(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, winreg_open_fn ret = False; } - if (deleted && test_OpenKey(p, mem_ctx, &handle, TEST_KEY1, &newhandle)) { + if (created && deleted && + test_OpenKey(p, mem_ctx, &handle, TEST_KEY1, &newhandle)) { printf("DeleteKey failed (OpenKey after Delete didn't work)\n"); ret = False; } @@ -775,6 +778,8 @@ static BOOL test_Open(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx, winreg_open_fn ret = False; } + test_Cleanup(p, mem_ctx, &handle, TEST_KEY_BASE); + return ret; } |