diff Python/getargs.c @ 62482:bb6222a4ed24

getbuffer(): release the buffer on error (if the buffer is not contiguous)
author Victor Stinner <victor.stinner@haypocalc.com>
date Thu, 24 Jun 2010 22:57:10 +0000
parents 893970141608
children bcc0e825faa0
line wrap: on
line diff
--- a/Python/getargs.c	Thu Jun 24 22:34:04 2010 +0000
+++ b/Python/getargs.c	Thu Jun 24 22:57:10 2010 +0000
@@ -1340,6 +1340,7 @@
         return -1;
     }
     if (!PyBuffer_IsContiguous(view, 'C')) {
+        PyBuffer_Release(view);
         *errmsg = "contiguous buffer";
         return -1;
     }