From: Alan T. DeKok Date: Sun, 17 Jul 2022 14:08:27 +0000 (-0400) Subject: don't record NOOPs X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=eb63f53bd916917ca7327ba907c105a8e9ee87b0;p=thirdparty%2Ffreeradius-server.git don't record NOOPs --- diff --git a/src/lib/util/edit.c b/src/lib/util/edit.c index d080395e8cb..4c78e389c5f 100644 --- a/src/lib/util/edit.c +++ b/src/lib/util/edit.c @@ -234,6 +234,15 @@ static int edit_record(fr_edit_list_t *el, fr_edit_op_t op, fr_pair_t *vp, fr_pa } } + /* + * Catch NOOPs + */ + if (op == FR_EDIT_CLEAR) { + fr_assert(fr_type_is_structural(vp->vp_type)); + + if (fr_pair_list_empty(&vp->vp_group)) return 0; + } + /* * Search for previous edits. * @@ -571,6 +580,11 @@ int fr_edit_list_free_pair_children(fr_edit_list_t *el, fr_pair_t *vp) return 0; } + /* + * No children == do nothing. + */ + if (fr_pair_list_empty(&vp->vp_group)) return 0; + /* * Record the list, even if it's empty. That way if we * later add children to it, the "undo" operation can