frontend/breakp.c, cleanup `dbfree1()' and `dbfree()'

This commit is contained in:
rlar 2016-03-03 19:49:45 +01:00
parent 8ce99a3c66
commit 1a257cd55a
1 changed files with 11 additions and 14 deletions

View File

@ -297,26 +297,23 @@ com_sttus(wordlist *wl)
*/ */
void void
dbfree1(struct dbcomm *dd) dbfree1(struct dbcomm *d)
{ {
tfree(dd->db_nodename1); tfree(d->db_nodename1);
tfree(dd->db_nodename2); tfree(d->db_nodename2);
if (dd->db_also) { if (d->db_also)
dbfree(dd->db_also); dbfree(d->db_also);
dd->db_also = NULL; tfree(d);
}
tfree(dd);
} }
void void
dbfree(struct dbcomm *db) dbfree(struct dbcomm *d)
{ {
struct dbcomm *dd, *dn; while (d) {
struct dbcomm *next_d = d->db_next;
for (dd = db; dd; dd = dn) { dbfree1(d);
dn = dd->db_next; d = next_d;
dbfree1(dd);
} }
} }