shogo82148 / Redis-Fast

fast perl binding for Redis database
https://metacpan.org/release/Redis-Fast
Other
25 stars 21 forks source link

do not self->ac = NULL out of callback functions #111

Closed shogo82148 closed 3 years ago

shogo82148 commented 3 years ago

it might leak self->ac.

shogo82148 commented 3 years ago

Who frees redisAsynContext? 🤔

https://github.com/redis/hiredis/blob/d5b4c69b7113213c1da3a0ccbfd1ee1b40443c7a/async.c#L338-L356

shogo82148 commented 3 years ago

I got it. &(ac->c) and ac are same address, so c = &(ac->c); hi_free(c); and hi_free(ac) are same. redisAsynContext is freed here. https://github.com/redis/hiredis/blob/dfa33e60b07c13328133a16065d88d171a2a61d4/hiredis.c#L741