mirror of
https://github.com/psycopg/psycopg2.git
synced 2024-11-22 08:56:34 +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)
|
||||
{
|
||||
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,
|
||||
|
|
Loading…
Reference in New Issue
Block a user