-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
Closed
Labels
extension-modulesC modules in the Modules dirC modules in the Modules dirtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Bug report
This call is problematic:
Line 465 in f526314
#define SET(i,val) PyStructSequence_SET_ITEM(v, i, PyLong_FromLong((long) val)) |
It can return NULL
in theory.
These calls also can return NULL
:
Lines 477 to 478 in f526314
PyStructSequence_SET_ITEM(v, 9, PyUnicode_DecodeLocale(p->tm_zone, "surrogateescape")); Lines 481 to 482 in f526314
PyStructSequence_SET_ITEM(v, 9, PyUnicode_DecodeLocale(zone, "surrogateescape"));
This error guard in the end will only show the last error:
Lines 486 to 489 in f526314
if (PyErr_Occurred()) { | |
Py_XDECREF(v); | |
return NULL; | |
} |
XDECREF
when v
cannot be NULL
at this point?
Refs #116714
I will send a PR adding our regular macro for the job.
Linked PRs
Metadata
Metadata
Assignees
Labels
extension-modulesC modules in the Modules dirC modules in the Modules dirtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error