File: | src/_imaging.c |
Function: | _getxy |
Error: | memory leak: ob_refcnt of '*int_value' is 1 too high |
1108 static inline int
1109 _getxy(PyObject *xy, int *x, int *y) {
1110 PyObject *value;
1111
1112 if (!PyTuple_Check(xy) || PyTuple_GET_SIZE(xy) != 2) {
when considering range: 1 <= value <= 0x4000000
taking False path
when considering value == (Py_ssize_t)2 from src/_imaging.c:1112
taking False path
1113 goto badarg;
1114 }
1115
1116 value = PyTuple_GET_ITEM(xy, 0);
1117 if (PyLong_Check(value)) {
when treating unknown struct PyObject * from src/_imaging.c:1116 as non-NULL
when treating unknown struct _typeobject * from src/_imaging.c:1117 as non-NULL
when considering value == (long unsigned int)0 from src/_imaging.c:1117
taking False path
1118 *x = PyLong_AS_LONG(value);
1119 } else if (PyFloat_Check(value)) {
when taking False path
when considering value == (int)0 from src/_imaging.c:1119
taking False path
1120 *x = (int)PyFloat_AS_DOUBLE(value);
1121 } else {
1122 PyObject *int_value = PyObject_CallMethod(value, "__int__", NULL);
when _PyObject_CallMethod_SizeT() succeeds
'*int_value' was allocated at: PyObject *int_value = PyObject_CallMethod(value, "__int__", NULL);
ob_refcnt is now refs: 1 owned
1123 if (int_value != NULL && PyLong_Check(int_value)) {
taking True path
when considering range: 1 <= value <= 0x1000000
taking True path
1124 *x = PyLong_AS_LONG(int_value);
when treating unknown int * from src/_imaging.c:1109 as non-NULL
1125 } else {
1126 goto badval;
1127 }
1128 }
1129
1130 value = PyTuple_GET_ITEM(xy, 1);
1131 if (PyLong_Check(value)) {
when treating unknown struct PyObject * from src/_imaging.c:1130 as non-NULL
when treating unknown struct _typeobject * from src/_imaging.c:1131 as non-NULL
when considering value == (long unsigned int)0 from src/_imaging.c:1131
taking False path
1132 *y = PyLong_AS_LONG(value);
1133 } else if (PyFloat_Check(value)) {
when taking False path
when considering range: -0x80000000 <= value <= -1
taking True path
1134 *y = (int)PyFloat_AS_DOUBLE(value);
when treating unknown int * from src/_imaging.c:1109 as non-NULL
1135 } else {
1136 PyObject *int_value = PyObject_CallMethod(value, "__int__", NULL);
1137 if (int_value != NULL && PyLong_Check(int_value)) {
1138 *y = PyLong_AS_LONG(int_value);
1139 } else {
1140 goto badval;
1141 }
1142 }
1143
1144 return 0;
memory leak: ob_refcnt of '*int_value' is 1 too high
was expecting final owned ob_refcnt of '*int_value' to be 0 since nothing references it but final ob_refcnt is refs: 1 owned
found 3 similar trace(s) to this
1145
1146 badarg:
1147 PyErr_SetString(PyExc_TypeError, "argument must be sequence of length 2");
1148 return -1;
1149
1150 badval:
1151 PyErr_SetString(PyExc_TypeError, "an integer is required");
1152 return -1;
1153 }
File: | src/_imaging.c |
Function: | _getxy |
Error: | memory leak: ob_refcnt of '*int_value' is 1 too high |
1108 static inline int
1109 _getxy(PyObject *xy, int *x, int *y) {
1110 PyObject *value;
1111
1112 if (!PyTuple_Check(xy) || PyTuple_GET_SIZE(xy) != 2) {
when considering range: 1 <= value <= 0x4000000
taking False path
when considering value == (Py_ssize_t)2 from src/_imaging.c:1112
taking False path
1113 goto badarg;
1114 }
1115
1116 value = PyTuple_GET_ITEM(xy, 0);
1117 if (PyLong_Check(value)) {
when treating unknown struct PyObject * from src/_imaging.c:1116 as non-NULL
when treating unknown struct _typeobject * from src/_imaging.c:1117 as non-NULL
when considering value == (long unsigned int)0 from src/_imaging.c:1117
taking False path
1118 *x = PyLong_AS_LONG(value);
1119 } else if (PyFloat_Check(value)) {
when taking False path
when considering value == (int)0 from src/_imaging.c:1119
taking False path
1120 *x = (int)PyFloat_AS_DOUBLE(value);
1121 } else {
1122 PyObject *int_value = PyObject_CallMethod(value, "__int__", NULL);
when _PyObject_CallMethod_SizeT() succeeds
'*int_value' was allocated at: PyObject *int_value = PyObject_CallMethod(value, "__int__", NULL);
ob_refcnt is now refs: 1 owned
1123 if (int_value != NULL && PyLong_Check(int_value)) {
taking True path
when considering value == (long unsigned int)0 from src/_imaging.c:1123
taking False path
1124 *x = PyLong_AS_LONG(int_value);
1125 } else {
1126 goto badval;
1127 }
1128 }
1129
1130 value = PyTuple_GET_ITEM(xy, 1);
1131 if (PyLong_Check(value)) {
1132 *y = PyLong_AS_LONG(value);
1133 } else if (PyFloat_Check(value)) {
1134 *y = (int)PyFloat_AS_DOUBLE(value);
1135 } else {
1136 PyObject *int_value = PyObject_CallMethod(value, "__int__", NULL);
1137 if (int_value != NULL && PyLong_Check(int_value)) {
1138 *y = PyLong_AS_LONG(int_value);
1139 } else {
1140 goto badval;
1141 }
1142 }
1143
1144 return 0;
1145
1146 badarg:
1147 PyErr_SetString(PyExc_TypeError, "argument must be sequence of length 2");
1148 return -1;
1149
1150 badval:
1151 PyErr_SetString(PyExc_TypeError, "an integer is required");
calling PyErr_SetString()
1152 return -1;
memory leak: ob_refcnt of '*int_value' is 1 too high
was expecting final owned ob_refcnt of '*int_value' to be 0 since nothing references it but final ob_refcnt is refs: 1 owned
found 2 similar trace(s) to this
1153 }