BUG/MEDIUM: spoa/python: Fixing references to None
authorGilchrist Dadaglo <dadaglo@amazon.com>
Tue, 8 Dec 2020 14:37:14 +0000 (14:37 +0000)
committerChristopher Faulet <cfaulet@haproxy.com>
Mon, 14 Dec 2020 10:49:52 +0000 (11:49 +0100)
commitdee0e24be33c95028b83fb5095426e8a287e5ae1
tree0f44f7c8772880f326f73d4fb437acb4e6060cb8
parent24ca83fa28554d3903b8e7fe52fdd507ba18c26c
BUG/MEDIUM: spoa/python: Fixing references to None

As per https://docs.python.org/3/c-api/none.html, None has to be treated
exactly like other objects for reference counting.
So, when we use it, we need to INCREF and when we are done, DECREF

This patch must be backported as far as 2.0.

(cherry picked from commit bdd034947c4a3a6f8c41af9bf6e62b7a74b4ebbc)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit 30189a6e056799f38d57478b04baded0868a431b)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit 752e24a9e42cd9fe76f6b0d070562dc180c92555)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
contrib/spoa_server/ps_python.c