diff options
author | Neal Norwitz <nnorwitz@gmail.com> | 2007-10-07 19:26:50 (GMT) |
---|---|---|
committer | Neal Norwitz <nnorwitz@gmail.com> | 2007-10-07 19:26:50 (GMT) |
commit | b35f128711e3dc618d92ab75eda3ba217904935e (patch) | |
tree | 60ff72f0e7dda914b0e140636afee2bae813a76b /Objects/memoryobject.c | |
parent | e43bd62b87b450bbd37e25629c6c3e8b1c75beae (diff) | |
download | cpython-b35f128711e3dc618d92ab75eda3ba217904935e.zip cpython-b35f128711e3dc618d92ab75eda3ba217904935e.tar.gz cpython-b35f128711e3dc618d92ab75eda3ba217904935e.tar.bz2 |
At least one of the buildbots was complaining about newview being used
without being initialized. Also make the code conform to the comment and
return the new object. This code needs a test!
Diffstat (limited to 'Objects/memoryobject.c')
-rw-r--r-- | Objects/memoryobject.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/Objects/memoryobject.c b/Objects/memoryobject.c index d06d7e5..754cbc1 100644 --- a/Objects/memoryobject.c +++ b/Objects/memoryobject.c @@ -513,12 +513,11 @@ memory_subscript(PyMemoryViewObject *self, PyObject *key) else { /* Return a new memory-view object */ Py_buffer newview; - PyMemoryView_FromMemory(&newview); + memset(&newview, 0, sizeof(newview)); + return PyMemoryView_FromMemory(&newview); } } - - Py_INCREF(Py_NotImplemented); return Py_NotImplemented; } |