Copy entire callback in one call

This commit is contained in:
Pieter Noordhuis 2010-12-31 11:22:13 +01:00
parent a020db3013
commit 2d53a6a711

View File

@ -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 */