From: Brett Cannon Date: Mon, 3 May 2010 23:57:15 +0000 (+0000) Subject: Fix two potential uninitialization errors and an unneeded assignment. X-Git-Tag: v2.7b2~105 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=79832844727411e374f638d6045e2d100e6c31fd;p=thirdparty%2FPython%2Fcpython.git Fix two potential uninitialization errors and an unneeded assignment. Found using Clang's static analyzer. --- diff --git a/Modules/bsddbmodule.c b/Modules/bsddbmodule.c index 09728821e32f..c55df1186ddd 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},