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>
Tue, 26 Jan 2021 11:07:27 +0000 (12:07 +0100)
commit78edc96b1063f00202c25217c14f505b05fbd6a6
tree02955777fac0e9696a76df7af692d9cd4a593f80
parent22c43367210777a93c0ca311952cf7a7c946a6fc
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>
(cherry picked from commit 54c88770d37ce28077dd4a20b8ffbb54a56cca8b)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit 780316e86b7170fe2951235f9bf214f26502fc14)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
src/sample.c