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
6dfe8f20
Commit
6dfe8f20
authored
Jul 28, 2015
by
Pieter Hintjens
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1492 from brian-peloton/fix-memory-leak
Fix a documented memory leak.
parents
80adc135
97969808
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
12 deletions
+8
-12
v1_decoder.cpp
src/v1_decoder.cpp
+6
-8
v2_decoder.cpp
src/v2_decoder.cpp
+2
-4
No files found.
src/v1_decoder.cpp
View file @
6dfe8f20
...
...
@@ -80,10 +80,9 @@ int zmq::v1_decoder_t::one_byte_size_ready (unsigned char const*)
return
-
1
;
}
// in_progress is initialised at this point so in theory we should
// close it before calling zmq_msg_init_size, however, it's a 0-byte
// message and thus we can treat it as uninitialised...
int
rc
=
in_progress
.
init_size
(
*
tmpbuf
-
1
);
int
rc
=
in_progress
.
close
();
assert
(
rc
==
0
);
rc
=
in_progress
.
init_size
(
*
tmpbuf
-
1
);
if
(
rc
!=
0
)
{
errno_assert
(
errno
==
ENOMEM
);
rc
=
in_progress
.
init
();
...
...
@@ -123,10 +122,9 @@ int zmq::v1_decoder_t::eight_byte_size_ready (unsigned char const*)
const
size_t
msg_size
=
static_cast
<
size_t
>
(
payload_length
-
1
);
// in_progress is initialised at this point so in theory we should
// close it before calling init_size, however, it's a 0-byte
// message and thus we can treat it as uninitialised...
int
rc
=
in_progress
.
init_size
(
msg_size
);
int
rc
=
in_progress
.
close
();
assert
(
rc
==
0
);
rc
=
in_progress
.
init_size
(
msg_size
);
if
(
rc
!=
0
)
{
errno_assert
(
errno
==
ENOMEM
);
rc
=
in_progress
.
init
();
...
...
src/v2_decoder.cpp
View file @
6dfe8f20
...
...
@@ -108,10 +108,8 @@ int zmq::v2_decoder_t::size_ready(uint64_t msg_size, unsigned char const* read_p
return
-
1
;
}
// in_progress is initialised at this point so in theory we should
// close it before calling init_size, however, it's a 0-byte
// message and thus we can treat it as uninitialised.
int
rc
=
-
1
;
int
rc
=
in_progress
.
close
();
assert
(
rc
==
0
);
// the current message can exceed the current buffer. We have to copy the buffer
// data into a new message and complete it in the next receive.
...
...
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