Mercurial > cpython-lru_cache-weakref
diff Objects/memoryobject.c @ 43485:074130a073b6
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!
| author | Neal Norwitz <nnorwitz@gmail.com> |
|---|---|
| date | Sun, 07 Oct 2007 19:26:50 +0000 |
| parents | 79b0db0356d3 |
| children | 8ba5300cb4b3 |
line wrap: on
line diff
--- a/Objects/memoryobject.c Sat Oct 06 08:23:10 2007 +0000 +++ b/Objects/memoryobject.c Sun Oct 07 19:26:50 2007 +0000 @@ -513,12 +513,11 @@ 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; }
