commit | fb6f43ee0c6a288e036ca616a29f6b7485d426c6 | [log] [tgz] |
---|---|---|
author | Max <msuraev@sysmocom.de> | Mon Mar 18 15:41:26 2019 +0100 |
committer | Harald Welte <laforge@gnumonks.org> | Tue Mar 19 12:57:10 2019 +0000 |
tree | 02534439581fd1ab9710c0d175162dd4656b46ca | |
parent | d488c7256fee60902fbef8bfeac211664769d63f [diff] |
rate_ctr_group_free(): guard against empty or NULL input Change-Id: I859a91ee4400b3685c05971f8c66bceca6758724
diff --git a/src/rate_ctr.c b/src/rate_ctr.c index 75302da..c9319a6 100644 --- a/src/rate_ctr.c +++ b/src/rate_ctr.c
@@ -255,7 +255,11 @@ /*! Free the memory for the specified group of counters */ void rate_ctr_group_free(struct rate_ctr_group *grp) { - llist_del(&grp->list); + if (!grp) + return; + + if (!llist_empty(&grp->list)) + llist_del(&grp->list); talloc_free(grp); }