]> git.kaiwu.me - haproxy.git/commit
BUG/MINOR: server: check strdup return on server-template ID generation
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Fri, 31 Jul 2026 13:45:28 +0000 (15:45 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Mon, 3 Aug 2026 09:12:54 +0000 (11:12 +0200)
commit9bbae558912c4c4d421257fc8f6bad2982fdf4c7
tree0a76ee6412458deba9df9f09ad75f251bd8528d6
parent467440a34f81c635ccb33d434328799b027cbf03
BUG/MINOR: server: check strdup return on server-template ID generation

Check strdup() return value when a server-template prefix is expanded
into the final server name. Now, an alert is reported in case of error
and server parsing is interrupted.

Along with this change, the server prefix expansion function has been
renamed and its documentation adjusted.

This could be backported to all stable releases. However, this depends
on a previous patch which prevents ignoring of errors during
server-template generation. As this is a minor fix which is only useful
after memory allocation failure, it is probably better to not pick them.
If backporting is considered necessary, the following patch is required
first.

  commit 467440a34f81c635ccb33d434328799b027cbf03
  MINOR: server: do not ignore errors during server-template init
src/server.c