summaryrefslogtreecommitdiffstats
path: root/Python/marshal.c
diff options
context:
space:
mode:
Diffstat (limited to 'Python/marshal.c')
-rw-r--r--Python/marshal.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Python/marshal.c b/Python/marshal.c
index d6cc04d..86cf57d 100644
--- a/Python/marshal.c
+++ b/Python/marshal.c
@@ -326,8 +326,8 @@ w_ref(PyObject *v, char *flag, WFILE *p)
goto err;
}
w = (int)s;
- Py_INCREF(v);
- if (_Py_hashtable_set(p->hashtable, v, (void *)(uintptr_t)w) < 0) {
+ if (_Py_hashtable_set(p->hashtable, Py_NewRef(v),
+ (void *)(uintptr_t)w) < 0) {
Py_DECREF(v);
goto err;
}