Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
2444f4af
Commit
2444f4af
authored
Mar 11, 2005
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace calloc() by HeapAlloc().
parent
bf08b35c
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
20 deletions
+19
-20
socket.c
dlls/wsock32/socket.c
+19
-20
No files found.
dlls/wsock32/socket.c
View file @
2444f4af
...
...
@@ -170,7 +170,7 @@ DWORD WINAPI WsControl(DWORD protocol,
ifTable
=
0
;
GetIfTable
(
NULL
,
&
ifTable
,
FALSE
);
table
=
(
PMIB_IFTABLE
)
calloc
(
1
,
ifTable
);
table
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
ifTable
);
if
(
!
table
)
return
ERROR_NOT_ENOUGH_MEMORY
;
GetIfTable
(
table
,
&
ifTable
,
FALSE
);
...
...
@@ -178,8 +178,8 @@ DWORD WINAPI WsControl(DWORD protocol,
spaceNeeded
=
sizeof
(
TDIEntityID
)
*
(
table
->
dwNumEntries
+
4
);
if
(
*
pcbResponseInfoLen
<
spaceNeeded
)
{
free
(
table
);
return
(
ERROR_LOCK_VIOLATION
)
;
HeapFree
(
GetProcessHeap
(),
0
,
table
);
return
ERROR_LOCK_VIOLATION
;
}
memset
(
baseptr
,
0
,
spaceNeeded
);
...
...
@@ -212,8 +212,7 @@ DWORD WINAPI WsControl(DWORD protocol,
}
*
pcbResponseInfoLen
=
spaceNeeded
;
free
(
table
);
HeapFree
(
GetProcessHeap
(),
0
,
table
);
break
;
}
...
...
@@ -288,7 +287,7 @@ DWORD WINAPI WsControl(DWORD protocol,
if
(
*
pcbResponseInfoLen
<
sizeof
(
ULONG
)
*
2
)
return
(
ERROR_LOCK_VIOLATION
);
GetIpNetTable
(
NULL
,
&
size
,
FALSE
);
table
=
(
PMIB_IPNETTABLE
)
calloc
(
1
,
size
);
table
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
size
);
if
(
!
table
)
return
ERROR_NOT_ENOUGH_MEMORY
;
GetIpNetTable
(
table
,
&
size
,
FALSE
);
...
...
@@ -302,7 +301,7 @@ DWORD WINAPI WsControl(DWORD protocol,
*/
*
(
output
++
)
=
table
->
dwNumEntries
;
*
output
=
table
->
table
[
0
].
dwIndex
;
free
(
table
);
HeapFree
(
GetProcessHeap
(),
0
,
table
);
*
pcbResponseInfoLen
=
sizeof
(
ULONG
)
*
2
;
}
break
;
...
...
@@ -400,7 +399,7 @@ DWORD WINAPI WsControl(DWORD protocol,
gets just one entry. */
tableSize
=
0
;
GetIpAddrTable
(
NULL
,
&
tableSize
,
FALSE
);
table
=
(
PMIB_IPADDRTABLE
)
calloc
(
1
,
tableSize
);
table
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
tableSize
);
if
(
!
table
)
return
ERROR_NOT_ENOUGH_MEMORY
;
GetIpAddrTable
(
table
,
&
tableSize
,
FALSE
);
...
...
@@ -415,7 +414,7 @@ DWORD WINAPI WsControl(DWORD protocol,
break
;
}
}
free
(
table
);
HeapFree
(
GetProcessHeap
(),
0
,
table
);
*
pcbResponseInfoLen
=
sizeof
(
MIB_IPADDRROW
);
break
;
...
...
@@ -447,12 +446,12 @@ DWORD WINAPI WsControl(DWORD protocol,
0
)
/
sizeof
(
MIB_IPFORWARDROW
)
+
1
;
if
(
*
pcbResponseInfoLen
<
sizeof
(
IPRouteEntry
)
*
numRoutes
)
return
(
ERROR_LOCK_VIOLATION
);
table
=
(
PMIB_IPFORWARDTABLE
)
calloc
(
1
,
routeTableSize
);
table
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
routeTableSize
);
if
(
!
table
)
return
ERROR_NOT_ENOUGH_MEMORY
;
ret
=
GetIpForwardTable
(
table
,
&
routeTableSize
,
FALSE
);
if
(
ret
!=
NO_ERROR
)
{
free
(
table
);
HeapFree
(
GetProcessHeap
(),
0
,
table
);
return
ret
;
}
...
...
@@ -480,7 +479,7 @@ DWORD WINAPI WsControl(DWORD protocol,
*
pcbResponseInfoLen
=
sizeof
(
IPRouteEntry
)
*
table
->
dwNumEntries
;
free
(
table
);
HeapFree
(
GetProcessHeap
(),
0
,
table
);
}
break
;
...
...
@@ -496,18 +495,18 @@ DWORD WINAPI WsControl(DWORD protocol,
0
)
/
sizeof
(
MIB_IPNETROW
)
+
1
;
if
(
*
pcbResponseInfoLen
<
sizeof
(
MIB_IPNETROW
)
*
numEntries
)
return
(
ERROR_LOCK_VIOLATION
);
table
=
(
PMIB_IPNETTABLE
)
calloc
(
1
,
arpTableSize
);
table
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
arpTableSize
);
if
(
!
table
)
return
ERROR_NOT_ENOUGH_MEMORY
;
ret
=
GetIpNetTable
(
table
,
&
arpTableSize
,
FALSE
);
if
(
ret
!=
NO_ERROR
)
{
free
(
table
);
HeapFree
(
GetProcessHeap
(),
0
,
table
);
return
ret
;
}
if
(
*
pcbResponseInfoLen
<
sizeof
(
MIB_IPNETROW
)
*
table
->
dwNumEntries
)
{
free
(
table
);
HeapFree
(
GetProcessHeap
(),
0
,
table
);
return
ERROR_LOCK_VIOLATION
;
}
memcpy
(
pResponseInfo
,
table
->
table
,
sizeof
(
MIB_IPNETROW
)
*
...
...
@@ -517,7 +516,7 @@ DWORD WINAPI WsControl(DWORD protocol,
*
pcbResponseInfoLen
=
sizeof
(
MIB_IPNETROW
)
*
table
->
dwNumEntries
;
free
(
table
);
HeapFree
(
GetProcessHeap
(),
0
,
table
);
}
break
;
...
...
@@ -534,18 +533,18 @@ DWORD WINAPI WsControl(DWORD protocol,
0
)
/
sizeof
(
MIB_TCPROW
)
+
1
;
if
(
*
pcbResponseInfoLen
<
sizeof
(
MIB_TCPROW
)
*
numEntries
)
return
(
ERROR_LOCK_VIOLATION
);
table
=
(
PMIB_TCPTABLE
)
calloc
(
1
,
tcpTableSize
);
table
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
tcpTableSize
);
if
(
!
table
)
return
ERROR_NOT_ENOUGH_MEMORY
;
ret
=
GetTcpTable
(
table
,
&
tcpTableSize
,
FALSE
);
if
(
ret
!=
NO_ERROR
)
{
free
(
table
);
HeapFree
(
GetProcessHeap
(),
0
,
table
);
return
ret
;
}
if
(
*
pcbResponseInfoLen
<
sizeof
(
MIB_TCPROW
)
*
table
->
dwNumEntries
)
{
free
(
table
);
HeapFree
(
GetProcessHeap
(),
0
,
table
);
return
ERROR_LOCK_VIOLATION
;
}
for
(
i
=
0
;
i
<
table
->
dwNumEntries
;
i
++
)
...
...
@@ -564,7 +563,7 @@ DWORD WINAPI WsControl(DWORD protocol,
*
pcbResponseInfoLen
=
sizeof
(
MIB_TCPROW
)
*
table
->
dwNumEntries
;
free
(
table
);
HeapFree
(
GetProcessHeap
(),
0
,
table
);
}
break
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment