[PATCH] secur32/tests: Fix HeapAlloc in setup_buffers().
Hans Leidekker
hans at codeweavers.com
Fri Mar 2 04:19:27 CST 2018
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.
More information about the wine-devel
mailing list