Skip to content

Commit 143145f

Browse files
committed
Resolve leak reference on warning failure
1 parent 5b4f0eb commit 143145f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Python/sysmodule.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ _PySys_GetRequiredAttr(PyObject *name)
9898
"sys.abiflags will be set to a meaningful value "
9999
"on all platforms in Python 3.16 instead of absent",
100100
/*stack_level=*/1) < 0) {
101+
Py_XDECREF(value);
101102
return NULL;
102103
}
103104
}
@@ -124,6 +125,7 @@ _PySys_GetRequiredAttrString(const char *name)
124125
"sys.abiflags will be set to a meaningful value "
125126
"on all platforms in Python 3.16 instead of absent",
126127
/*stack_level=*/1) < 0) {
128+
Py_XDECREF(value);
127129
return NULL;
128130
}
129131
}

0 commit comments

Comments
 (0)