[PATCH] secur32/tests: Fix HeapAlloc in setup_buffers().
Signed-off-by: Andrey Gusev <andrey.goosev(a)gmail.com> --- dlls/secur32/tests/negotiate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/secur32/tests/negotiate.c b/dlls/secur32/tests/negotiate.c index 095aee6cb5..44dfc52868 100644 --- a/dlls/secur32/tests/negotiate.c +++ b/dlls/secur32/tests/negotiate.c @@ -100,7 +100,7 @@ static void setup_buffers( struct sspi_data *data, SecPkgInfoA *info ) buffer->BufferType = SECBUFFER_TOKEN; buffer->pvBuffer = HeapAlloc( GetProcessHeap(), 0, info->cbMaxToken ); - buffer = HeapAlloc( GetProcessHeap(), 0, sizeof(SecBuffer) ); + SecBuffer *buffer = HeapAlloc( GetProcessHeap(), 0, sizeof(SecBuffer) ); data->out_buf->ulVersion = SECBUFFER_VERSION; data->out_buf->cBuffers = 1; -- 2.13.6
Hi, While running your changed tests on Windows, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check? Full results can be found at https://testbot.winehq.org/JobDetails.pl?Key=36371 Your paranoid android. === build (build) === Make failed
On Fri, 2018-03-02 at 12:03 +0200, Andrey Gusev wrote:
diff --git a/dlls/secur32/tests/negotiate.c b/dlls/secur32/tests/negotiate.c
index 095aee6cb5..44dfc52868 100644 --- a/dlls/secur32/tests/negotiate.c +++ b/dlls/secur32/tests/negotiate.c @@ -100,7 +100,7 @@ static void setup_buffers( struct sspi_data *data, SecPkgInfoA *info ) buffer->BufferType = SECBUFFER_TOKEN; buffer->pvBuffer = HeapAlloc( GetProcessHeap(), 0, info->cbMaxToken ); - buffer = HeapAlloc( GetProcessHeap(), 0, sizeof(SecBuffer) ); + SecBuffer *buffer = HeapAlloc( GetProcessHeap(), 0, sizeof(SecBuffer) );
That may fix a warning from your tool but it doesn't fix any leak. It seems we can avoid these allocations by embedding the SecBufferDesc and SecBuffer structures in struct sspi_data.
participants (3)
-
Andrey Gusev -
Hans Leidekker -
Marvin