From 1a257cd55a6df1fa05888962f629e49be4ca856d Mon Sep 17 00:00:00 2001 From: rlar Date: Thu, 3 Mar 2016 19:49:45 +0100 Subject: [PATCH] frontend/breakp.c, cleanup `dbfree1()' and `dbfree()' --- src/frontend/breakp.c | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/src/frontend/breakp.c b/src/frontend/breakp.c index cfcf54bc0..25b2232f6 100644 --- a/src/frontend/breakp.c +++ b/src/frontend/breakp.c @@ -297,26 +297,23 @@ com_sttus(wordlist *wl) */ void -dbfree1(struct dbcomm *dd) +dbfree1(struct dbcomm *d) { - tfree(dd->db_nodename1); - tfree(dd->db_nodename2); - if (dd->db_also) { - dbfree(dd->db_also); - dd->db_also = NULL; - } - tfree(dd); + tfree(d->db_nodename1); + tfree(d->db_nodename2); + if (d->db_also) + dbfree(d->db_also); + tfree(d); } void -dbfree(struct dbcomm *db) +dbfree(struct dbcomm *d) { - struct dbcomm *dd, *dn; - - for (dd = db; dd; dd = dn) { - dn = dd->db_next; - dbfree1(dd); + while (d) { + struct dbcomm *next_d = d->db_next; + dbfree1(d); + d = next_d; } }