From 627a8972615d04a9914ce361d983ae76ea0e1277 Mon Sep 17 00:00:00 2001 From: Philipp Maier Date: Tue, 14 Dec 2021 15:32:53 +0100 Subject: [PATCH] stat_item: tolerate NULL pointer argument in osmo_stat_item_group_free Just like rate_ctr_group_free, osmo_stat_item_group_free should tolerate it when the argument is NULL Change-Id: I23323833e7268356a50c4fc6a19639c4ecd2a101 --- src/stat_item.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/stat_item.c b/src/stat_item.c index 1f398d5e3..804972bf4 100644 --- a/src/stat_item.c +++ b/src/stat_item.c @@ -224,6 +224,9 @@ struct osmo_stat_item_group *osmo_stat_item_group_alloc(void *ctx, /*! Free the memory for the specified group of stat items */ void osmo_stat_item_group_free(struct osmo_stat_item_group *grp) { + if (!grp) + return; + llist_del(&grp->list); talloc_free(grp); }