summaryrefslogtreecommitdiff
path: root/source/nmbd/nmbd_serverlistdb.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>1998-08-30 04:27:26 +0000
committerAndrew Tridgell <tridge@samba.org>1998-08-30 04:27:26 +0000
commitc5e5c25c854e54f59291057ba47c4701b5910ebe (patch)
treedb5e5fda202a062e8f7be1791e748d266588ec1d /source/nmbd/nmbd_serverlistdb.c
parenta564e4662711d384069757ce3ee5adcadc1b061d (diff)
downloadsamba-c5e5c25c854e54f59291057ba47c4701b5910ebe.tar.gz
added some defensive programming to nmbd. This mostly means zeroing
areas of memory before freeing them. While doing this I also found a couple of real bugs. In two places we were freeing some memory that came from the stack, which leads to a certain core dump on many sytems.
Diffstat (limited to 'source/nmbd/nmbd_serverlistdb.c')
-rw-r--r--source/nmbd/nmbd_serverlistdb.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/source/nmbd/nmbd_serverlistdb.c b/source/nmbd/nmbd_serverlistdb.c
index 6ff6ad5c5d7..a4dab6f419d 100644
--- a/source/nmbd/nmbd_serverlistdb.c
+++ b/source/nmbd/nmbd_serverlistdb.c
@@ -56,6 +56,7 @@ void remove_all_servers(struct work_record *work)
if (work->serverlist == servrec)
work->serverlist = servrec->next;
+ ZERO_STRUCTP(servrec);
free((char *)servrec);
}
@@ -120,6 +121,7 @@ void remove_server_from_workgroup(struct work_record *work, struct server_record
if (work->serverlist == servrec)
work->serverlist = servrec->next;
+ ZERO_STRUCTP(servrec);
free((char *)servrec);
work->subnet->work_changed = True;
}