summaryrefslogtreecommitdiffstats
path: root/Modules/bsddbmodule.c
diff options
context:
space:
mode:
authorBrett Cannon <bcannon@gmail.com>2010-05-03 23:57:15 (GMT)
committerBrett Cannon <bcannon@gmail.com>2010-05-03 23:57:15 (GMT)
commit79832844727411e374f638d6045e2d100e6c31fd (patch)
tree8e8c44863d8f39eee3cb388de6aedd25a5cbb17d /Modules/bsddbmodule.c
parent8ffe7bbb72768290e34d2af6dc0ad9818b45ce7e (diff)
downloadcpython-79832844727411e374f638d6045e2d100e6c31fd.zip
cpython-79832844727411e374f638d6045e2d100e6c31fd.tar.gz
cpython-79832844727411e374f638d6045e2d100e6c31fd.tar.bz2
Fix two potential uninitialization errors and an unneeded assignment.
Found using Clang's static analyzer.
Diffstat (limited to 'Modules/bsddbmodule.c')
-rw-r--r--Modules/bsddbmodule.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/Modules/bsddbmodule.c b/Modules/bsddbmodule.c
index 0972882..c55df11 100644
--- a/Modules/bsddbmodule.c
+++ b/Modules/bsddbmodule.c
@@ -270,11 +270,12 @@ 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;
-
+
if (dp->di_type == DB_RECNO) {
if (!PyArg_Parse(key, "i", &recno)) {
PyErr_SetString(PyExc_TypeError,
@@ -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},