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
ac13c9f0
Commit
ac13c9f0
authored
Nov 01, 2010
by
Pieter Noordhuis
Browse files
Only copy relevant fields from callback ptr to avoid copying garbage
parent
a66ec18e
Changes
1
Hide whitespace changes
Inline
Side-by-side
async.c
View file @
ac13c9f0
...
...
@@ -75,8 +75,10 @@ static int __redisPushCallback(redisCallbackList *list, redisCallback *source) {
/* Copy callback from stack to heap */
cb
=
calloc
(
1
,
sizeof
(
*
cb
));
if
(
!
cb
)
redisOOM
();
if
(
source
!=
NULL
)
memcpy
(
cb
,
source
,
sizeof
(
*
cb
));
if
(
source
!=
NULL
)
{
cb
->
fn
=
source
->
fn
;
cb
->
privdata
=
source
->
privdata
;
}
/* Store callback in list */
if
(
list
->
head
==
NULL
)
...
...
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