Commit 21e09487 authored by Victor Stinner's avatar Victor Stinner

getbuffer(): release the buffer on error (if the buffer is not contiguous)

parent 8bae4ec6
......@@ -1340,6 +1340,7 @@ getbuffer(PyObject *arg, Py_buffer *view, char **errmsg)
return -1;
}
if (!PyBuffer_IsContiguous(view, 'C')) {
PyBuffer_Release(view);
*errmsg = "contiguous buffer";
return -1;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment