Copy entire callback in one call
This commit is contained in:
parent
a020db3013
commit
2d53a6a711
6
async.c
6
async.c
@ -119,11 +119,11 @@ static int __redisPushCallback(redisCallbackList *list, redisCallback *source) {
|
|||||||
redisCallback *cb;
|
redisCallback *cb;
|
||||||
|
|
||||||
/* Copy callback from stack to heap */
|
/* Copy callback from stack to heap */
|
||||||
cb = calloc(1,sizeof(*cb));
|
cb = malloc(sizeof(*cb));
|
||||||
if (!cb) redisOOM();
|
if (!cb) redisOOM();
|
||||||
if (source != NULL) {
|
if (source != NULL) {
|
||||||
cb->fn = source->fn;
|
memcpy(cb,source,sizeof(*cb));
|
||||||
cb->privdata = source->privdata;
|
cb->next = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Store callback in list */
|
/* Store callback in list */
|
||||||
|
Loading…
Reference in New Issue
Block a user