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
1d38462e
Commit
1d38462e
authored
Dec 06, 2004
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed a leak in getsockname.
Replaced malloc by HeapAlloc.
parent
da41f988
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
socket.c
dlls/winsock/socket.c
+5
-5
No files found.
dlls/winsock/socket.c
View file @
1d38462e
...
@@ -772,8 +772,7 @@ static const struct sockaddr* ws_sockaddr_ws2u(const struct WS_sockaddr* wsaddr,
...
@@ -772,8 +772,7 @@ static const struct sockaddr* ws_sockaddr_ws2u(const struct WS_sockaddr* wsaddr,
return
NULL
;
return
NULL
;
*
uaddrlen
=
sizeof
(
struct
sockaddr_ipx
);
*
uaddrlen
=
sizeof
(
struct
sockaddr_ipx
);
uipx
=
malloc
(
*
uaddrlen
);
uipx
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
*
uaddrlen
);
memset
(
uipx
,
0
,
sizeof
(
*
uipx
));
uipx
->
sipx_family
=
AF_IPX
;
uipx
->
sipx_family
=
AF_IPX
;
uipx
->
sipx_port
=
wsipx
->
sa_socket
;
uipx
->
sipx_port
=
wsipx
->
sa_socket
;
/* copy sa_netnum and sa_nodenum to sipx_network and sipx_node
/* copy sa_netnum and sa_nodenum to sipx_network and sipx_node
...
@@ -816,7 +815,7 @@ inline struct sockaddr* ws_sockaddr_alloc(const struct WS_sockaddr* wsaddr, int*
...
@@ -816,7 +815,7 @@ inline struct sockaddr* ws_sockaddr_alloc(const struct WS_sockaddr* wsaddr, int*
else
else
*
uaddrlen
=
max
(
sizeof
(
struct
sockaddr
),
*
wsaddrlen
);
*
uaddrlen
=
max
(
sizeof
(
struct
sockaddr
),
*
wsaddrlen
);
return
malloc
(
*
uaddrlen
);
return
HeapAlloc
(
GetProcessHeap
(),
0
,
*
uaddrlen
);
}
}
/* Returns 0 if successful, -1 if the buffer is too small */
/* Returns 0 if successful, -1 if the buffer is too small */
...
@@ -885,8 +884,8 @@ static int ws_sockaddr_u2ws(const struct sockaddr* uaddr, int uaddrlen, struct W
...
@@ -885,8 +884,8 @@ static int ws_sockaddr_u2ws(const struct sockaddr* uaddr, int uaddrlen, struct W
*/
*/
inline
void
ws_sockaddr_free
(
const
struct
sockaddr
*
uaddr
,
const
struct
WS_sockaddr
*
wsaddr
)
inline
void
ws_sockaddr_free
(
const
struct
sockaddr
*
uaddr
,
const
struct
WS_sockaddr
*
wsaddr
)
{
{
if
(
uaddr
!=
NULL
&&
uaddr
!=
(
const
struct
sockaddr
*
)
wsaddr
)
if
(
uaddr
!=
(
const
struct
sockaddr
*
)
wsaddr
)
free
((
void
*
)
uaddr
);
HeapFree
(
GetProcessHeap
(),
0
,
(
void
*
)
uaddr
);
}
}
/**************************************************************************
/**************************************************************************
...
@@ -1576,6 +1575,7 @@ int WINAPI WS_getsockname(SOCKET s, struct WS_sockaddr *name, int *namelen)
...
@@ -1576,6 +1575,7 @@ int WINAPI WS_getsockname(SOCKET s, struct WS_sockaddr *name, int *namelen)
{
{
res
=
0
;
res
=
0
;
}
}
ws_sockaddr_free
(
uaddr
,
name
);
release_sock_fd
(
s
,
fd
);
release_sock_fd
(
s
,
fd
);
}
}
return
res
;
return
res
;
...
...
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