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
f081205b
Commit
f081205b
authored
Aug 16, 2023
by
Alex Henrie
Committed by
Alexandre Julliard
Sep 15, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
http: Use CRT allocation functions.
parent
b47a3305
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
7 deletions
+6
-7
http.c
dlls/http.sys/http.c
+6
-7
No files found.
dlls/http.sys/http.c
View file @
f081205b
...
@@ -25,7 +25,6 @@
...
@@ -25,7 +25,6 @@
#include "winternl.h"
#include "winternl.h"
#include "ddk/wdm.h"
#include "ddk/wdm.h"
#include "wine/debug.h"
#include "wine/debug.h"
#include "wine/heap.h"
#include "wine/list.h"
#include "wine/list.h"
static
HANDLE
directory_obj
;
static
HANDLE
directory_obj
;
...
@@ -118,17 +117,17 @@ static void accept_connection(SOCKET socket)
...
@@ -118,17 +117,17 @@ static void accept_connection(SOCKET socket)
if
((
peer
=
accept
(
socket
,
NULL
,
NULL
))
==
INVALID_SOCKET
)
if
((
peer
=
accept
(
socket
,
NULL
,
NULL
))
==
INVALID_SOCKET
)
return
;
return
;
if
(
!
(
conn
=
heap_alloc_zero
(
sizeof
(
*
conn
))))
if
(
!
(
conn
=
calloc
(
1
,
sizeof
(
*
conn
))))
{
{
ERR
(
"Failed to allocate memory.
\n
"
);
ERR
(
"Failed to allocate memory.
\n
"
);
shutdown
(
peer
,
SD_BOTH
);
shutdown
(
peer
,
SD_BOTH
);
closesocket
(
peer
);
closesocket
(
peer
);
return
;
return
;
}
}
if
(
!
(
conn
->
buffer
=
heap_
alloc
(
8192
)))
if
(
!
(
conn
->
buffer
=
m
alloc
(
8192
)))
{
{
ERR
(
"Failed to allocate buffer memory.
\n
"
);
ERR
(
"Failed to allocate buffer memory.
\n
"
);
heap_
free
(
conn
);
free
(
conn
);
shutdown
(
peer
,
SD_BOTH
);
shutdown
(
peer
,
SD_BOTH
);
closesocket
(
peer
);
closesocket
(
peer
);
return
;
return
;
...
@@ -142,11 +141,11 @@ static void accept_connection(SOCKET socket)
...
@@ -142,11 +141,11 @@ static void accept_connection(SOCKET socket)
static
void
close_connection
(
struct
connection
*
conn
)
static
void
close_connection
(
struct
connection
*
conn
)
{
{
heap_
free
(
conn
->
buffer
);
free
(
conn
->
buffer
);
shutdown
(
conn
->
socket
,
SD_BOTH
);
shutdown
(
conn
->
socket
,
SD_BOTH
);
closesocket
(
conn
->
socket
);
closesocket
(
conn
->
socket
);
list_remove
(
&
conn
->
entry
);
list_remove
(
&
conn
->
entry
);
heap_
free
(
conn
);
free
(
conn
);
}
}
static
HTTP_VERB
parse_verb
(
const
char
*
verb
,
int
len
)
static
HTTP_VERB
parse_verb
(
const
char
*
verb
,
int
len
)
...
@@ -629,7 +628,7 @@ static void receive_data(struct connection *conn)
...
@@ -629,7 +628,7 @@ static void receive_data(struct connection *conn)
if
(
available
)
if
(
available
)
{
{
TRACE
(
"%lu more bytes of data available, trying with larger buffer.
\n
"
,
available
);
TRACE
(
"%lu more bytes of data available, trying with larger buffer.
\n
"
,
available
);
if
(
!
(
conn
->
buffer
=
heap_
realloc
(
conn
->
buffer
,
conn
->
len
+
available
)))
if
(
!
(
conn
->
buffer
=
realloc
(
conn
->
buffer
,
conn
->
len
+
available
)))
{
{
ERR
(
"Failed to allocate %lu bytes of memory.
\n
"
,
conn
->
len
+
available
);
ERR
(
"Failed to allocate %lu bytes of memory.
\n
"
,
conn
->
len
+
available
);
close_connection
(
conn
);
close_connection
(
conn
);
...
...
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