]> PatchyGit - patchyircd.git/commitdiff
Fixed possible double free
authorSam Smith <sam@patchysicp.xyz>
Sun, 24 Apr 2022 21:28:59 +0000 (14:28 -0700)
committerSam Smith <sam@patchysicp.xyz>
Sun, 24 Apr 2022 21:28:59 +0000 (14:28 -0700)
net.c

diff --git a/net.c b/net.c
index 70c2cc0..e226102 100644 (file)
--- a/net.c
+++ b/net.c
@@ -54,7 +54,7 @@ void recvProc(struct client_data *cl) {
        char tmp;
        while(1){
                // I hate you
-               if(cl->bufLen == cl->bufCap) killConnection(cl);
+               if(cl->bufLen == cl->bufCap) { killConnection(cl); return; }
                bytesRead = recv_log(cl->FD,cl->buf + cl->bufLen,cl->bufCap - cl->bufLen, 0);
                switch(bytesRead){
                        // Disconnect