mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2024-12-20 02:30:13 +00:00
CLEANUP: log: use free_logformat_list() in parse_logformat_string()
This is a follow up for 24a5e42db6
("CLEANUP: log: deinitialization of
the log buffer in one function") as there was another opportunity to
make use of the new cleanup function.
This commit is contained in:
parent
e7aee6edd5
commit
62121d5b90
@ -515,7 +515,6 @@ int parse_logformat_string(const char *fmt, struct proxy *curproxy, struct list
|
|||||||
int typecast = SMP_T_SAME; /* relaxed by default */
|
int typecast = SMP_T_SAME; /* relaxed by default */
|
||||||
int cformat; /* current token format */
|
int cformat; /* current token format */
|
||||||
int pformat; /* previous token format */
|
int pformat; /* previous token format */
|
||||||
struct logformat_node *tmplf, *back;
|
|
||||||
|
|
||||||
sp = str = backfmt = strdup(fmt);
|
sp = str = backfmt = strdup(fmt);
|
||||||
if (!str) {
|
if (!str) {
|
||||||
@ -525,12 +524,7 @@ int parse_logformat_string(const char *fmt, struct proxy *curproxy, struct list
|
|||||||
curproxy->to_log |= LW_INIT;
|
curproxy->to_log |= LW_INIT;
|
||||||
|
|
||||||
/* flush the list first. */
|
/* flush the list first. */
|
||||||
list_for_each_entry_safe(tmplf, back, list_format, list) {
|
free_logformat_list(list_format);
|
||||||
LIST_DELETE(&tmplf->list);
|
|
||||||
release_sample_expr(tmplf->expr);
|
|
||||||
free(tmplf->arg);
|
|
||||||
free(tmplf);
|
|
||||||
}
|
|
||||||
|
|
||||||
for (cformat = LF_INIT; cformat != LF_END; str++) {
|
for (cformat = LF_INIT; cformat != LF_END; str++) {
|
||||||
pformat = cformat;
|
pformat = cformat;
|
||||||
|
Loading…
Reference in New Issue
Block a user