{
char *dict_dir = NULL;
fr_dict_t *dict;
+ bool added = false;
*out = NULL;
* When we have A->B->A, it means that we don't need to track B->A, because we track
* A->B. And if A is freed, then B is freed.
*/
- if (!dict->loading) dict_dependent_add(dict, dependent);
+ if (!dict->loading) {
+ added = true;
+ dict_dependent_add(dict, dependent);
+ }
/*
* But we only return a pre-existing dict if _this function_ has loaded it.
talloc_free(dict_dir);
- dict_dependent_add(dict, dependent);
+ if (!added) dict_dependent_add(dict, dependent);
*out = dict;