Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
L
libzmq
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
libzmq
Commits
367cedb7
Commit
367cedb7
authored
Apr 11, 2019
by
Thomas M. DuBuisson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix request-handling memory leak
parent
2c89c069
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
18 deletions
+4
-18
req.cpp
src/req.cpp
+4
-18
No files found.
src/req.cpp
View file @
367cedb7
...
...
@@ -36,14 +36,6 @@
#include "random.hpp"
#include "likely.hpp"
extern
"C"
{
static
void
free_id
(
void
*
data_
,
void
*
hint_
)
{
LIBZMQ_UNUSED
(
hint_
);
free
(
data_
);
}
}
zmq
::
req_t
::
req_t
(
class
ctx_t
*
parent_
,
uint32_t
tid_
,
int
sid_
)
:
dealer_t
(
parent_
,
tid_
,
sid_
),
_receiving_reply
(
false
),
...
...
@@ -81,22 +73,16 @@ int zmq::req_t::xsend (msg_t *msg_)
if
(
_request_id_frames_enabled
)
{
_request_id
++
;
// Copy request id before sending (see issue #1695 for details).
uint32_t
*
request_id_copy
=
static_cast
<
uint32_t
*>
(
malloc
(
sizeof
(
uint32_t
)));
zmq_assert
(
request_id_copy
);
*
request_id_copy
=
_request_id
;
msg_t
id
;
int
rc
=
id
.
init_data
(
request_id_copy
,
sizeof
(
uint32_t
),
free_id
,
NULL
);
int
rc
=
id
.
init_size
(
sizeof
(
uint32_t
));
memcpy
(
id
.
data
(),
&
_request_id
,
sizeof
(
uint32_t
)
);
errno_assert
(
rc
==
0
);
id
.
set_flags
(
msg_t
::
more
);
rc
=
dealer_t
::
sendpipe
(
&
id
,
&
_reply_pipe
);
if
(
rc
!=
0
)
if
(
rc
!=
0
)
{
return
-
1
;
}
}
msg_t
bottom
;
...
...
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