Author: jerry Date: 2006-01-15 12:30:36 +0000 (Sun, 15 Jan 2006) New Revision: 12946
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=12946 Log: fix a segfault in nmbd when 'wins support = yes' caused by double free Modified: branches/SAMBA_3_0/source/nmbd/nmbd_namelistdb.c trunk/source/nmbd/nmbd_namelistdb.c Changeset: Modified: branches/SAMBA_3_0/source/nmbd/nmbd_namelistdb.c =================================================================== --- branches/SAMBA_3_0/source/nmbd/nmbd_namelistdb.c 2006-01-15 09:03:28 UTC (rev 12945) +++ branches/SAMBA_3_0/source/nmbd/nmbd_namelistdb.c 2006-01-15 12:30:36 UTC (rev 12946) @@ -82,9 +82,11 @@ { if (subrec == wins_server_subnet) { remove_name_from_wins_namelist(namerec); - } else { - subrec->namelist_changed = True; - } + return; + } + + subrec->namelist_changed = True; + DLIST_REMOVE(subrec->namelist, namerec); SAFE_FREE(namerec->data.ip); ZERO_STRUCTP(namerec); Modified: trunk/source/nmbd/nmbd_namelistdb.c =================================================================== --- trunk/source/nmbd/nmbd_namelistdb.c 2006-01-15 09:03:28 UTC (rev 12945) +++ trunk/source/nmbd/nmbd_namelistdb.c 2006-01-15 12:30:36 UTC (rev 12946) @@ -82,9 +82,11 @@ { if (subrec == wins_server_subnet) { remove_name_from_wins_namelist(namerec); - } else { - subrec->namelist_changed = True; - } + return; + } + + subrec->namelist_changed = True; + DLIST_REMOVE(subrec->namelist, namerec); SAFE_FREE(namerec->data.ip); ZERO_STRUCTP(namerec);