mirror of
https://github.com/psycopg/psycopg2.git
synced 2025-02-17 01:20:32 +03:00
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:
parent
1f62b47dc5
commit
27b26bc210
|
@ -286,7 +286,7 @@ static PyObject *
|
||||||
interval_from_usecs(const char *str)
|
interval_from_usecs(const char *str)
|
||||||
{
|
{
|
||||||
PyObject *us = NULL;
|
PyObject *us = NULL;
|
||||||
char *pend;
|
char *pend = NULL;
|
||||||
PyObject *rv = NULL;
|
PyObject *rv = NULL;
|
||||||
|
|
||||||
Dprintf("interval_from_usecs: %s", str);
|
Dprintf("interval_from_usecs: %s", str);
|
||||||
|
@ -296,7 +296,7 @@ interval_from_usecs(const char *str)
|
||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (*pend != '\0') {
|
if (pend && *pend != '\0') {
|
||||||
/* there are trailing chars, it's not just micros. Barf. */
|
/* there are trailing chars, it's not just micros. Barf. */
|
||||||
Dprintf("interval_from_usecs: spurious chars %s", pend);
|
Dprintf("interval_from_usecs: spurious chars %s", pend);
|
||||||
PyErr_Format(PyExc_ValueError,
|
PyErr_Format(PyExc_ValueError,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user