Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
mongoose
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
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
esp
mongoose
Commits
a6678814
Commit
a6678814
authored
Mar 11, 2012
by
Sergey Lyubka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Checking malloc return code in worker_thread()
parent
cda24d94
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
mongoose.c
mongoose.c
+4
-1
No files found.
mongoose.c
View file @
a6678814
...
@@ -3956,9 +3956,12 @@ static void worker_thread(struct mg_context *ctx) {
...
@@ -3956,9 +3956,12 @@ static void worker_thread(struct mg_context *ctx) {
int
buf_size
=
atoi
(
ctx
->
config
[
MAX_REQUEST_SIZE
]);
int
buf_size
=
atoi
(
ctx
->
config
[
MAX_REQUEST_SIZE
]);
conn
=
(
struct
mg_connection
*
)
calloc
(
1
,
sizeof
(
*
conn
)
+
buf_size
);
conn
=
(
struct
mg_connection
*
)
calloc
(
1
,
sizeof
(
*
conn
)
+
buf_size
);
if
(
conn
==
NULL
)
{
cry
(
fc
(
ctx
),
"%s"
,
"Cannot create new connection struct, OOM"
);
return
;
}
conn
->
buf_size
=
buf_size
;
conn
->
buf_size
=
buf_size
;
conn
->
buf
=
(
char
*
)
(
conn
+
1
);
conn
->
buf
=
(
char
*
)
(
conn
+
1
);
assert
(
conn
!=
NULL
);
// Call consume_socket() even when ctx->stop_flag > 0, to let it signal
// Call consume_socket() even when ctx->stop_flag > 0, to let it signal
// sq_empty condvar to wake up the master waiting in produce_socket()
// sq_empty condvar to wake up the master waiting in produce_socket()
...
...
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