From: Victor Stinner Date: Thu, 24 Jun 2010 22:57:10 +0000 (+0000) Subject: getbuffer(): release the buffer on error (if the buffer is not contiguous) X-Git-Tag: v3.2a1~464 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=21e09487ac9d4365819ae4de31319ae3df9a8b17;p=python getbuffer(): release the buffer on error (if the buffer is not contiguous) --- diff --git a/Python/getargs.c b/Python/getargs.c index ab95e1e547..41b4af56cf 100644 --- a/Python/getargs.c +++ b/Python/getargs.c @@ -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; }