Commit 6d748ce3 authored by Alex Henrie's avatar Alex Henrie Committed by Alexandre Julliard

winhttp: Use specific types insted of sizeof(ULONG_PTR) in alloc_handle.

Resolves a scan-build warning.
parent 44168cf4
......@@ -94,15 +94,15 @@ HINTERNET alloc_handle( struct object_header *hdr )
if (!max_handles)
{
num = HANDLE_CHUNK_SIZE;
if (!(p = calloc( 1, sizeof(ULONG_PTR) * num ))) goto end;
if (!(p = calloc( 1, sizeof(*p) * num ))) goto end;
handles = p;
max_handles = num;
}
if (max_handles == next_handle)
{
size_t new_size, old_size = max_handles * sizeof(ULONG_PTR);
size_t new_size, old_size = max_handles * sizeof(*handles);
num = max_handles * 2;
new_size = num * sizeof(ULONG_PTR);
new_size = num * sizeof(*handles);
if (!(p = realloc( handles, new_size ))) goto end;
memset( (char *)p + old_size, 0, new_size - old_size );
handles = p;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment