diff options
author | Max <msuraev@sysmocom.de> | 2019-03-18 15:41:26 +0100 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2019-03-19 12:57:10 +0000 |
commit | fb6f43ee0c6a288e036ca616a29f6b7485d426c6 (patch) | |
tree | 02534439581fd1ab9710c0d175162dd4656b46ca /src | |
parent | d488c7256fee60902fbef8bfeac211664769d63f (diff) |
rate_ctr_group_free(): guard against empty or NULL input
Change-Id: I859a91ee4400b3685c05971f8c66bceca6758724
Diffstat (limited to 'src')
-rw-r--r-- | src/rate_ctr.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/rate_ctr.c b/src/rate_ctr.c index 75302da2..c9319a6f 100644 --- a/src/rate_ctr.c +++ b/src/rate_ctr.c @@ -255,7 +255,11 @@ struct rate_ctr_group *rate_ctr_group_alloc(void *ctx, /*! 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); } |