BUG/MINOR: hlua: prevent function and table reference leaks on errors
authorAurelien DARRAGON <adarragon@haproxy.com>
Thu, 2 Mar 2023 17:42:06 +0000 (18:42 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Wed, 5 Apr 2023 06:58:17 +0000 (08:58 +0200)
commit55afbedfb4d4013a7dda16db16b6dc27eb7ed762
treeac0e46b09bf3d004b3cec6d7df9d553c005ab03b
parent16d047b615408e05e35f0a655962ff755d6924a4
BUG/MINOR: hlua: prevent function and table reference leaks on errors

Several error paths were leaking function or table references.
(Obtained through hlua_checkfunction() and hlua_checktable() functions)

Now we properly release the references thanks to hlua_unref() in
such cases.

This commit depends on "MINOR: hlua: add simple hlua reference handling API"

This could be backported in every stable versions although it is not
mandatory as such leaks only occur on rare error/warn paths.
[prior to 2.5 lua filter API did not exist, the hlua_register_filter()
part should be skipped]
src/hlua.c