mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-11 19:11:08 +00:00
install() replaces an existing cache entry by calling detach(old), which destroys the listing when no reader holds it, and then reads old->wd to decide whether to release the watch. When the old listing has no readers, that read happens after the free. Two threads that enumerate the same uncached directory at the same time reach this path: both build a listing, the first installs an entry with no readers, and the second replaces it. Save the watch descriptor before detaching, as drop() already does. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>