[X2serv-cvs] CVS: x2/source commands.c,1.120,1.121
Brought to you by:
sirvulcan
From: Alex S. <ru...@us...> - 2001-01-15 22:08:55
|
Update of /cvsroot/x2serv/x2/source In directory usw-pr-cvs1:/tmp/cvs-serv30409/source Modified Files: commands.c Log Message: My previous patch to free the userlist of unreg'd channels contained an error, referencing previously free'd memory space. Fixed. Index: commands.c =================================================================== RCS file: /cvsroot/x2serv/x2/source/commands.c,v retrieving revision 1.120 retrieving revision 1.121 diff -C2 -r1.120 -r1.121 *** commands.c 2001/01/14 08:55:45 1.120 --- commands.c 2001/01/15 22:08:48 1.121 *************** *** 3702,3707 **** char ChanName[LINEBUFFSIZE]; int s, line = 0; ! HandleListType hptr; ! LamerListType lptr; ChanFile = fopen(CHANFILENAME, "r"); --- 3702,3707 ---- char ChanName[LINEBUFFSIZE]; int s, line = 0; ! HandleListType tmphptr, nexthptr; ! LamerListType lptr, nextlptr; ChanFile = fopen(CHANFILENAME, "r"); *************** *** 3782,3792 **** /* Delete userlist, and lamerlist.. */ ! for(hptr = cptr->Handles;hptr;hptr = hptr->Next) { ! DelHandle(cptr, hptr); } cptr->Handles = NULL; ! for(lptr = cptr->Lamers;lptr;lptr = lptr->Next) { free(lptr); } --- 3782,3794 ---- /* Delete userlist, and lamerlist.. */ ! for(tmphptr = cptr->Handles;tmphptr;tmphptr = nexthptr) { ! nexthptr = tmphptr->Next; ! DelHandle(cptr, tmphptr); } cptr->Handles = NULL; ! for(lptr = cptr->Lamers;lptr;lptr = nextlptr) { + nextlptr = lptr->Next; free(lptr); } |