From 2d53a6a7110b6d28226f653d9f4c94082205017a Mon Sep 17 00:00:00 2001 From: Pieter Noordhuis Date: Fri, 31 Dec 2010 11:22:13 +0100 Subject: Copy entire callback in one call --- async.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'async.c') diff --git a/async.c b/async.c index 4409307..323b489 100644 --- a/async.c +++ b/async.c @@ -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 */ -- cgit v1.2.3