diff options
-rw-r--r-- | src/rate_ctr.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/rate_ctr.c b/src/rate_ctr.c index 54644909..477339f2 100644 --- a/src/rate_ctr.c +++ b/src/rate_ctr.c @@ -190,15 +190,6 @@ struct rate_ctr_group *rate_ctr_group_alloc(void *ctx, unsigned int size; struct rate_ctr_group *group; - /* attempt to mangle all '.' in identifiers to ':' for backwards compat */ - if (!rate_ctrl_group_desc_validate(desc, true)) { - /* don't use 'ctx' here as it would screw up memory leak debugging e.g. - * in osmo-msc */ - desc = rate_ctr_group_desc_mangle(NULL, desc); - if (!desc) - return NULL; - } - size = sizeof(struct rate_ctr_group) + desc->num_ctr * sizeof(struct rate_ctr); @@ -209,6 +200,15 @@ struct rate_ctr_group *rate_ctr_group_alloc(void *ctx, if (!group) return NULL; + /* attempt to mangle all '.' in identifiers to ':' for backwards compat */ + if (!rate_ctrl_group_desc_validate(desc, true)) { + desc = rate_ctr_group_desc_mangle(group, desc); + if (!desc) { + talloc_free(group); + return NULL; + } + } + group->desc = desc; group->idx = idx; |