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
hiredis
Commits
847a2012
Commit
847a2012
authored
Jan 20, 2019
by
valentino
Committed by
Mark Nunberg
Feb 20, 2019
Browse files
Fix memory leaks
parent
58222c26
Changes
2
Hide whitespace changes
Inline
Side-by-side
adapters/libevent.h
View file @
847a2012
...
@@ -48,10 +48,10 @@ static void redisLibeventHandler(int fd, short event, void *arg) {
...
@@ -48,10 +48,10 @@ static void redisLibeventHandler(int fd, short event, void *arg) {
if
(
event
&
EV_TIMEOUT
)
{
if
(
event
&
EV_TIMEOUT
)
{
redisAsyncHandleTimeout
(
e
->
context
);
redisAsyncHandleTimeout
(
e
->
context
);
}
}
if
(
e
->
context
&&
(
event
&
EV_READ
))
{
if
((
event
&
EV_READ
)
&&
e
->
context
)
{
redisAsyncHandleRead
(
e
->
context
);
redisAsyncHandleRead
(
e
->
context
);
}
}
if
(
e
->
context
&&
(
event
&
EV_WRITE
))
{
if
((
event
&
EV_WRITE
)
&&
e
->
context
)
{
redisAsyncHandleWrite
(
e
->
context
);
redisAsyncHandleWrite
(
e
->
context
);
}
}
}
}
...
@@ -107,7 +107,6 @@ static void redisLibeventSetTimeout(void *privdata, struct timeval tv) {
...
@@ -107,7 +107,6 @@ static void redisLibeventSetTimeout(void *privdata, struct timeval tv) {
short
flags
=
e
->
flags
;
short
flags
=
e
->
flags
;
e
->
flags
=
0
;
e
->
flags
=
0
;
e
->
tv
=
tv
;
e
->
tv
=
tv
;
event_del
(
e
->
ev
);
redisLibeventUpdate
(
e
,
flags
,
0
);
redisLibeventUpdate
(
e
,
flags
,
0
);
}
}
...
...
hiredis.c
View file @
847a2012
...
@@ -618,6 +618,7 @@ void redisFree(redisContext *c) {
...
@@ -618,6 +618,7 @@ void redisFree(redisContext *c) {
if
(
c
->
ssl
)
{
if
(
c
->
ssl
)
{
redisFreeSsl
(
c
->
ssl
);
redisFreeSsl
(
c
->
ssl
);
}
}
free
(
c
);
}
}
int
redisFreeKeepFd
(
redisContext
*
c
)
{
int
redisFreeKeepFd
(
redisContext
*
c
)
{
...
...
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