Fixed apparent access to uninitialized var

No error before: cpychecker is confused but the var was init'd by
PyLong_FromString.

davidmalcolm/gcc-python-plugin#167
This commit is contained in:
Daniele Varrazzo 2019-01-23 09:30:05 +00:00
parent 1f62b47dc5
commit 27b26bc210

View File

@ -286,7 +286,7 @@ static PyObject *
interval_from_usecs(const char *str)
{
PyObject *us = NULL;
char *pend;
char *pend = NULL;
PyObject *rv = NULL;
Dprintf("interval_from_usecs: %s", str);
@ -296,7 +296,7 @@ interval_from_usecs(const char *str)
goto exit;
}
if (*pend != '\0') {
if (pend && *pend != '\0') {
/* there are trailing chars, it's not just micros. Barf. */
Dprintf("interval_from_usecs: spurious chars %s", pend);
PyErr_Format(PyExc_ValueError,