Skip to content

Commit ae18ce8

Browse files
committed
Fix dangerous reference count decrement
1 parent c740fe3 commit ae18ce8

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Python/instrumentation.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2559,19 +2559,19 @@ PyObject *_Py_CreateMonitoringObject(void)
25592559
if (err) goto error;
25602560
PyObject *val = PyLong_FromLong(PY_MONITORING_DEBUGGER_ID);
25612561
err = PyObject_SetAttrString(mod, "DEBUGGER_ID", val);
2562-
Py_DECREF(val);
2562+
Py_XDECREF(val);
25632563
if (err) goto error;
25642564
val = PyLong_FromLong(PY_MONITORING_COVERAGE_ID);
25652565
err = PyObject_SetAttrString(mod, "COVERAGE_ID", val);
2566-
Py_DECREF(val);
2566+
Py_XDECREF(val);
25672567
if (err) goto error;
25682568
val = PyLong_FromLong(PY_MONITORING_PROFILER_ID);
25692569
err = PyObject_SetAttrString(mod, "PROFILER_ID", val);
2570-
Py_DECREF(val);
2570+
Py_XDECREF(val);
25712571
if (err) goto error;
25722572
val = PyLong_FromLong(PY_MONITORING_OPTIMIZER_ID);
25732573
err = PyObject_SetAttrString(mod, "OPTIMIZER_ID", val);
2574-
Py_DECREF(val);
2574+
Py_XDECREF(val);
25752575
if (err) goto error;
25762576
return mod;
25772577
error:

0 commit comments

Comments
 (0)