From 318682b00377605a26d0b7fd4b59713c6c429b81 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 28 Sep 2006 06:44:47 +0000 Subject: r18971: avoid strndup is a few places. Fixes a minor memory leak, and should fix RPC-LSA on AIX. (This used to be commit 6cce709d08579f4e00b44b692332a557b0ea3b86) --- source4/torture/rpc/lsa.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'source4/torture/rpc/lsa.c') diff --git a/source4/torture/rpc/lsa.c b/source4/torture/rpc/lsa.c index 84bc90963d..575426a409 100644 --- a/source4/torture/rpc/lsa.c +++ b/source4/torture/rpc/lsa.c @@ -976,7 +976,8 @@ static BOOL test_CreateSecret(struct dcerpc_pipe *p, blob2 = data_blob_talloc(mem_ctx, NULL, blob1.length); - secret2 = sess_decrypt_string(&blob1, &session_key); + secret2 = sess_decrypt_string(mem_ctx, + &blob1, &session_key); if (strcmp(secret1, secret2) != 0) { printf("Returned secret '%s' doesn't match '%s'\n", @@ -1036,7 +1037,8 @@ static BOOL test_CreateSecret(struct dcerpc_pipe *p, blob2 = data_blob_talloc(mem_ctx, NULL, blob1.length); - secret4 = sess_decrypt_string(&blob1, &session_key); + secret4 = sess_decrypt_string(mem_ctx, + &blob1, &session_key); if (strcmp(secret3, secret4) != 0) { printf("Returned NEW secret %s doesn't match %s\n", secret4, secret3); @@ -1048,7 +1050,8 @@ static BOOL test_CreateSecret(struct dcerpc_pipe *p, blob2 = data_blob_talloc(mem_ctx, NULL, blob1.length); - secret2 = sess_decrypt_string(&blob1, &session_key); + secret2 = sess_decrypt_string(mem_ctx, + &blob1, &session_key); if (strcmp(secret1, secret2) != 0) { printf("Returned OLD secret %s doesn't match %s\n", secret2, secret1); @@ -1122,7 +1125,8 @@ static BOOL test_CreateSecret(struct dcerpc_pipe *p, blob2 = data_blob_talloc(mem_ctx, NULL, blob1.length); - secret6 = sess_decrypt_string(&blob1, &session_key); + secret6 = sess_decrypt_string(mem_ctx, + &blob1, &session_key); if (strcmp(secret3, secret4) != 0) { printf("Returned NEW secret '%s' doesn't match '%s'\n", secret4, secret3); @@ -1134,7 +1138,8 @@ static BOOL test_CreateSecret(struct dcerpc_pipe *p, blob2 = data_blob_talloc(mem_ctx, NULL, blob1.length); - secret6 = sess_decrypt_string(&blob1, &session_key); + secret6 = sess_decrypt_string(mem_ctx, + &blob1, &session_key); if (strcmp(secret5, secret6) != 0) { printf("Returned OLD secret %s doesn't match %s\n", secret5, secret6); -- cgit