Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
978df2e0
Commit
978df2e0
authored
Feb 02, 2022
by
Alex Henrie
Committed by
Alexandre Julliard
Feb 02, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ws2_32: Fix memory leak on error path in get_local_ips (cppcheck).
Signed-off-by:
Alex Henrie
<
alexhenrie24@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
950792ae
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
protocol.c
dlls/ws2_32/protocol.c
+4
-3
No files found.
dlls/ws2_32/protocol.c
View file @
978df2e0
...
...
@@ -806,7 +806,7 @@ static struct hostent *get_local_ips( char *hostname )
IP_ADAPTER_INFO
*
adapters
=
NULL
,
*
k
;
struct
hostent
*
hostlist
=
NULL
;
MIB_IPFORWARDTABLE
*
routes
=
NULL
;
struct
route
*
route_addrs
=
NULL
;
struct
route
*
route_addrs
=
NULL
,
*
new_route_addrs
;
DWORD
adap_size
,
route_size
,
n
;
/* Obtain the size of the adapter list and routing table, also allocate memory */
...
...
@@ -852,9 +852,10 @@ static struct hostent *get_local_ips( char *hostname )
}
if
(
exists
)
continue
;
route_addrs
=
realloc
(
route_addrs
,
(
numroutes
+
1
)
*
sizeof
(
struct
route
)
);
if
(
!
route_addrs
)
new_
route_addrs
=
realloc
(
route_addrs
,
(
numroutes
+
1
)
*
sizeof
(
struct
route
)
);
if
(
!
new_
route_addrs
)
goto
cleanup
;
route_addrs
=
new_route_addrs
;
route_addrs
[
numroutes
].
interface
=
ifindex
;
route_addrs
[
numroutes
].
metric
=
ifmetric
;
route_addrs
[
numroutes
].
default_route
=
ifdefault
;
...
...
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