mirror of
https://github.com/python/cpython.git
synced 2025-12-04 08:34:25 +00:00
Fix two potential uninitialization errors and an unneeded assignment.
Found using Clang's static analyzer.
This commit is contained in:
parent
8ffe7bbb72
commit
7983284472
1 changed files with 6 additions and 4 deletions
|
|
@ -270,7 +270,8 @@ bsddb_subscript(bsddbobject *dp, PyObject *key)
|
|||
{
|
||||
int status;
|
||||
DBT krec, drec;
|
||||
char *data,buf[4096];
|
||||
char *data = NULL;
|
||||
char buf[4096];
|
||||
int size;
|
||||
PyObject *result;
|
||||
recno_t recno;
|
||||
|
|
@ -503,7 +504,8 @@ bsddb_set_location(bsddbobject *dp, PyObject *key)
|
|||
{
|
||||
int status;
|
||||
DBT krec, drec;
|
||||
char *data,buf[4096];
|
||||
char *data = NULL;
|
||||
char buf[4096];
|
||||
int size;
|
||||
PyObject *result;
|
||||
recno_t recno;
|
||||
|
|
@ -635,7 +637,7 @@ bsddb_sync(bsddbobject *dp)
|
|||
PyErr_SetFromErrno(BsddbError);
|
||||
return NULL;
|
||||
}
|
||||
return PyInt_FromLong(status = 0);
|
||||
return PyInt_FromLong(0);
|
||||
}
|
||||
static PyMethodDef bsddb_methods[] = {
|
||||
{"close", (PyCFunction)bsddb_close, METH_NOARGS},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue