[PATCH] dcookies.c: use proper refcounting functions