]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: contrib/spoa-server: Do not free reference to NULL
authorGilchrist Dadaglo <dadaglo@amazon.com>
Mon, 24 Aug 2020 19:21:33 +0000 (19:21 +0000)
committerChristopher Faulet <cfaulet@haproxy.com>
Tue, 1 Sep 2020 16:28:40 +0000 (18:28 +0200)
As per https://docs.python.org/3/c-api/refcounting.html, Py_DECREF
should not be called on NULL objects.

This patch must be backported as far as 2.0.

contrib/spoa_server/ps_python.c

index 427ef18ee0eef8cbc76859c7c3f1d06dd31ba0cb..474c75b22f9ef1f9b499f1111829d82895e5aaa6 100644 (file)
@@ -558,7 +558,6 @@ static int ps_python_exec_message(struct worker *w, void *ref, int nargs, struct
                ent = PyDict_New();
                if (ent == NULL) {
                        Py_DECREF(kw_args);
-                       Py_DECREF(ent);
                        PyErr_Print();
                        return 0;
                }