mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-21 22:01:31 +02:00
BUG/MINOR: config: Make use_backend and use-server post-parsing less obscur
During use_backend and use-server post-parsing, if the log-format string used to specify the backend or the server is just a single string, the log-format string (a list, internally) is replaced by the string itself. Because the field is an union, the list is not emptied according to the rules of art. The element, when released, is not removed from the list. There is no bug, but it is clearly not obvious and error prone. This patch should fix #544. The fix for the use_backend post-parsing may be backported to all stable releases. use-server is static in 2.1 and prior.
This commit is contained in:
parent
ad9f9ed3f4
commit
f82ea4ae4c
@ -2654,7 +2654,10 @@ int check_config_validity()
|
|||||||
free(pxname);
|
free(pxname);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
/* simple string: free the expression and fall back to static rule */
|
/* Only one element in the list, a simple string: free the expression and
|
||||||
|
* fall back to static rule
|
||||||
|
*/
|
||||||
|
LIST_DEL(&node->list);
|
||||||
free(node->arg);
|
free(node->arg);
|
||||||
free(node);
|
free(node);
|
||||||
}
|
}
|
||||||
@ -2715,6 +2718,10 @@ int check_config_validity()
|
|||||||
free(server_name);
|
free(server_name);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
/* Only one element in the list, a simple string: free the expression and
|
||||||
|
* fall back to static rule
|
||||||
|
*/
|
||||||
|
LIST_DEL(&node->list);
|
||||||
free(node->arg);
|
free(node->arg);
|
||||||
free(node);
|
free(node);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user