catgirl: [PATCH] Fix use-after-free in windowClose()

catgirl: [PATCH] Fix use-after-free in windowClose()

From: Alcor
Cc: june
Hi,

I found this issue while testing other changes after compiling with
-fsanitize=address.

The problem should be visible from the diff, I guess. windowShow(swap)
seems to access `window' after it is freed (the ASan instrumentation
detects this if a /close command is issued in a query or channel window
without any argument).

Pulling down the windowFree() call after the read usage seems to fix
this.

Cheers,
-Alcor