From ac13c9f09572227882e02a025373bf3147f49863 Mon Sep 17 00:00:00 2001 From: Pieter Noordhuis Date: Mon, 1 Nov 2010 10:13:05 +0100 Subject: Only copy relevant fields from callback ptr to avoid copying garbage --- async.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/async.c b/async.c index ec452af..746cfce 100644 --- a/async.c +++ b/async.c @@ -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) -- cgit v1.2.3