BUG/MINOR: sample: Memory leak of sample_expr structure in case of error
authorRemi Tricot-Le Breton <rlebreton@haproxy.com>
Tue, 12 Jan 2021 13:55:12 +0000 (14:55 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Wed, 13 Jan 2021 12:41:18 +0000 (13:41 +0100)
commit54c88770d37ce28077dd4a20b8ffbb54a56cca8b
treec93ae5cf59bf01fb770bde3df5b2886a59360bda
parentaddba8f9601deabd359011b93d53fd5050248e75
BUG/MINOR: sample: Memory leak of sample_expr structure in case of error

If an errors occurs during the sample expression parsing, the alloced
sample_expr is not freed despite having its main pointer reset.

This fixes GitHub issue #1046.
It could be backported as far as 1.8.

(cherry picked from commit 22e0d9b39cfb238e7bf866b3d78aa9b393004508)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
src/sample.c