From 21e09487ac9d4365819ae4de31319ae3df9a8b17 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Thu, 24 Jun 2010 22:57:10 +0000 Subject: [PATCH] getbuffer(): release the buffer on error (if the buffer is not contiguous) --- Python/getargs.c | 1 + 1 file changed, 1 insertion(+) 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; } -- 2.40.0