summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Berg <bberg@redhat.com>2021-12-29 05:05:32 +0100
committerBenjamin Berg <bberg@redhat.com>2022-03-28 10:18:21 +0200
commitbab52da8bff7f5057594c7fa9b6798b8553a89b3 (patch)
tree2e91dc5713458a121cce4a11d30300b12ada8f9a
parent086c99c41ccc7b06c6a158d69038d5afdba558dc (diff)
downloadpygobject-bab52da8bff7f5057594c7fa9b6798b8553a89b3.tar.gz
hashtable: Fix refcount of key/value in error case when marshalling
PyList_GET_ITEM only returns a borrowed reference. In the unlikely event of an error converting the key or value, the reference would be unintentionally decremented. This could cause random failures later on (and was indeed causing the PyPy test to fail randomly later on).
-rw-r--r--gi/pygi-hashtable.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/gi/pygi-hashtable.c b/gi/pygi-hashtable.c
index 285eca19..26d5f61c 100644
--- a/gi/pygi-hashtable.c
+++ b/gi/pygi-hashtable.c
@@ -139,8 +139,6 @@ _pygi_marshal_from_py_ghash (PyGIInvokeState *state,
continue;
err:
/* FIXME: cleanup hash keys and values */
- Py_XDECREF (py_key);
- Py_XDECREF (py_value);
Py_DECREF (py_keys);
Py_DECREF (py_values);
g_hash_table_unref (hash_);