From: Willy Tarreau Date: Tue, 3 Nov 2020 12:36:58 +0000 (+0100) Subject: MINOR: pattern: during reload, delete elements frem the ref, not the expression X-Git-Tag: v2.4-dev1~82 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2817472bb07ae1b5f8a0f73aa154ea5ec6c193bc;p=thirdparty%2Fhaproxy.git MINOR: pattern: during reload, delete elements frem the ref, not the expression Instead of scanning all elements from the expression and using the slow delete path there, let's use the faster way which involves pat_delete_gen() while the elements are detached from ther reference. --- diff --git a/src/pattern.c b/src/pattern.c index 9b58d35184..b2f06fea70 100644 --- a/src/pattern.c +++ b/src/pattern.c @@ -2074,9 +2074,8 @@ void pat_ref_reload(struct pat_ref *ref, struct pat_ref *replace) LIST_DEL_INIT(&bref->users); bref->ref = NULL; } + pat_delete_gen(ref, elt); LIST_DEL(&elt->list); - LIST_DEL(&elt->list_head); - LIST_DEL(&elt->tree_head); free(elt->pattern); free(elt->sample); free(elt); @@ -2087,7 +2086,6 @@ void pat_ref_reload(struct pat_ref *ref, struct pat_ref *replace) LIST_DEL(&replace->head); list_for_each_entry(expr, &ref->pat, list) { - expr->pat_head->prune(expr); list_for_each_entry(elt, &ref->head, list) { char *err = NULL; struct sample_data *data = NULL;