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
070da216
Commit
070da216
authored
Jan 15, 2014
by
Charlie Somerville
Browse files
async.c: avoid a NULL deref when redisAsyncInitialize returns NULL
parent
81c95a5f
Changes
1
Hide whitespace changes
Inline
Side-by-side
async.c
View file @
070da216
...
@@ -174,6 +174,11 @@ redisAsyncContext *redisAsyncConnectUnix(const char *path) {
...
@@ -174,6 +174,11 @@ redisAsyncContext *redisAsyncConnectUnix(const char *path) {
return
NULL
;
return
NULL
;
ac
=
redisAsyncInitialize
(
c
);
ac
=
redisAsyncInitialize
(
c
);
if
(
ac
==
NULL
)
{
redisFree
(
c
);
return
NULL
;
}
__redisAsyncCopyError
(
ac
);
__redisAsyncCopyError
(
ac
);
return
ac
;
return
ac
;
}
}
...
@@ -398,7 +403,7 @@ void redisProcessCallbacks(redisAsyncContext *ac) {
...
@@ -398,7 +403,7 @@ void redisProcessCallbacks(redisAsyncContext *ac) {
__redisAsyncDisconnect
(
ac
);
__redisAsyncDisconnect
(
ac
);
return
;
return
;
}
}
/* If monitor mode, repush callback */
/* If monitor mode, repush callback */
if
(
c
->
flags
&
REDIS_MONITORING
)
{
if
(
c
->
flags
&
REDIS_MONITORING
)
{
__redisPushCallback
(
&
ac
->
replies
,
&
cb
);
__redisPushCallback
(
&
ac
->
replies
,
&
cb
);
...
...
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