diff options
author | Marcus Comstedt <marcus@mc.pp.se> | 2017-02-26 12:52:12 +0100 |
---|---|---|
committer | Uwe Hermann <uwe@hermann-uwe.de> | 2017-02-26 14:56:56 +0100 |
commit | 066fbafdc3ba734a73b5f7fcfa1dbae67ddebf8a (patch) | |
tree | 18fda8ccb22b2f055e08f224e2cafec83ddf28ae /type_decoder.c | |
parent | e27d3e67cb69d54936399cd97a4c40c9842549a7 (diff) | |
download | libsigrokdecode-066fbafdc3ba734a73b5f7fcfa1dbae67ddebf8a.tar.gz libsigrokdecode-066fbafdc3ba734a73b5f7fcfa1dbae67ddebf8a.zip |
Fix refcounting bug in set_new_condition_list()
py_conditionlist is an owned reference (it gets passed to Py_DecRef()
at the end), so we need to increment the refcount when assigning it
from the borrowed reference py_conds.
Diffstat (limited to 'type_decoder.c')
-rw-r--r-- | type_decoder.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/type_decoder.c b/type_decoder.c index 0858098..9481bdb 100644 --- a/type_decoder.c +++ b/type_decoder.c @@ -535,6 +535,7 @@ static int set_new_condition_list(PyObject *self, PyObject *args) num_conditions = PyList_Size(py_conditionlist); if (num_conditions == 0) return 9999; /* The PD invoked self.wait([]). */ + Py_IncRef(py_conditionlist); } else if (PyDict_Check(py_conds)) { /* 'py_conds' is a dict. */ if (PyDict_Size(py_conds) == 0) |