diff options
author | Benjamin Peterson <benjamin@python.org> | 2016-10-06 06:29:22 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2016-10-06 06:29:22 (GMT) |
commit | 578f1bd578daa3a7f993a256425236646d354fbd (patch) | |
tree | 39891f2cf7b5d5a129f1eee8125dae0a7043cac8 | |
parent | ecdd36ff889db63f99ed841c51e7dbe1c4b60e4a (diff) | |
parent | 43441c77b5fd9617d7baff1cf3bbc072fef6035b (diff) | |
download | cpython-578f1bd578daa3a7f993a256425236646d354fbd.zip cpython-578f1bd578daa3a7f993a256425236646d354fbd.tar.gz cpython-578f1bd578daa3a7f993a256425236646d354fbd.tar.bz2 |
merge 3.6
-rw-r--r-- | Modules/mmapmodule.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Modules/mmapmodule.c b/Modules/mmapmodule.c index 3008444..da68447 100644 --- a/Modules/mmapmodule.c +++ b/Modules/mmapmodule.c @@ -383,8 +383,10 @@ mmap_write_method(mmap_object *self, if (!PyArg_ParseTuple(args, "y*:write", &data)) return(NULL); - if (!is_writable(self)) + if (!is_writable(self)) { + PyBuffer_Release(&data); return NULL; + } if (self->pos > self->size || self->size - self->pos < data.len) { PyBuffer_Release(&data); |