]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: tools: free previously allocated strings on strdup failure in backup_env()
authorWilly Tarreau <w@1wt.eu>
Sun, 26 Apr 2026 20:48:17 +0000 (22:48 +0200)
committerWilly Tarreau <w@1wt.eu>
Mon, 27 Apr 2026 12:44:29 +0000 (14:44 +0200)
commiteb97e21a8f0d4f01bbcaeeacae2c1266def4b4cb
tree8d4f7db88a9562ff095650a11e992179f9c39116
parentd5efce7a130222385564bb5cda925f027539a9df
BUG/MINOR: tools: free previously allocated strings on strdup failure in backup_env()

When strdup() fails after some entries have already been strdup'd, the function
returned -1 without freeing previously allocated strings. Added cleanup loop to
free all previously strdup'd entries and reset init_env.

This can be backported to 3.1.
src/tools.c