commit 86c7e6038c1f96cc8920b0ea91981506fd85e98d
parent 94234b24b65f020fda317bd0900482901deaa696
Author: Claudio Alessi <smoppy@gmail.com>
Date: Tue, 23 Aug 2022 22:38:47 +0200
Fix a use after free.
Diffstat:
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/circo.c b/circo.c
@@ -1363,12 +1363,12 @@ recv_part(char *who, char *chan, char *txt) {
if(!b)
return;
if(!strcmp(who, nick)) {
- detach(b);
- freebuf(b);
if(b == sel) {
sel = sel->next ? sel->next : buffers;
sel->need_redraw |= REDRAW_ALL;
}
+ detach(b);
+ freebuf(b);
}
else {
bprintf(b, "%CPART%..0C %s (%s)\n", colors[IRCMessage], who, txt);