From b35f128711e3dc618d92ab75eda3ba217904935e Mon Sep 17 00:00:00 2001 From: Neal Norwitz Date: Sun, 7 Oct 2007 19:26:50 +0000 Subject: 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! --- Objects/memoryobject.c | 5 ++--- 1 file 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; } -- cgit v0.12