Commit 2d53a6a7 authored by Pieter Noordhuis's avatar Pieter Noordhuis
Browse files

Copy entire callback in one call

parent a020db30
......@@ -119,11 +119,11 @@ static int __redisPushCallback(redisCallbackList *list, redisCallback *source) {
redisCallback *cb;
/* Copy callback from stack to heap */
cb = calloc(1,sizeof(*cb));
cb = malloc(sizeof(*cb));
if (!cb) redisOOM();
if (source != NULL) {
cb->fn = source->fn;
cb->privdata = source->privdata;
memcpy(cb,source,sizeof(*cb));
cb->next = NULL;
}
/* Store callback in list */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment