BUG/MINOR: spoa/python: Cleanup references for failed Module Addobject operations
authorGilchrist Dadaglo <dadaglo@amazon.com>
Tue, 8 Dec 2020 14:37:11 +0000 (14:37 +0000)
committerChristopher Faulet <cfaulet@haproxy.com>
Mon, 14 Dec 2020 08:31:02 +0000 (09:31 +0100)
commit2efe413b82d4fd35178ecb96e7b5f4336deb4cc5
treedfa9d8d7fd477296891cf6990f3d1abb91180e57
parentd809b3c32c61b5804e47b38cb61a54da4beec73c
BUG/MINOR: spoa/python: Cleanup references for failed Module Addobject operations

As per https://docs.python.org/3/c-api/module.html#c.PyModule_AddObject,
references are stolen by the function only for success. We must do
cleanup manually if there is a failure

This patch must be backported as far as 2.0.

(cherry picked from commit 132d8f61e9440b9254069ca2c4bcff67df29bb6f)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
contrib/spoa_server/ps_python.c