Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
76d87f47
Commit
76d87f47
authored
Feb 20, 2017
by
antirez
Browse files
Don't leak file descriptor on syncWithMaster().
Close #3804.
parent
f917e0da
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/replication.c
View file @
76d87f47
...
...
@@ -1568,7 +1568,7 @@ int slaveTryPartialResynchronization(int fd, int read_reply) {
* establish a connection with the master. */
void
syncWithMaster
(
aeEventLoop
*
el
,
int
fd
,
void
*
privdata
,
int
mask
)
{
char
tmpfile
[
256
],
*
err
=
NULL
;
int
dfd
,
maxtries
=
5
;
int
dfd
=
-
1
,
maxtries
=
5
;
int
sockerr
=
0
,
psync_result
;
socklen_t
errlen
=
sizeof
(
sockerr
);
UNUSED
(
el
);
...
...
@@ -1832,6 +1832,7 @@ void syncWithMaster(aeEventLoop *el, int fd, void *privdata, int mask) {
error:
aeDeleteFileEvent
(
server
.
el
,
fd
,
AE_READABLE
|
AE_WRITABLE
);
if
(
dfd
!=
-
1
)
close
(
dfd
);
close
(
fd
);
server
.
repl_transfer_s
=
-
1
;
server
.
repl_state
=
REPL_STATE_CONNECT
;
...
...
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