summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorMark Dickinson <dickinsm@gmail.com>2010-07-04 10:15:59 (GMT)
committerMark Dickinson <dickinsm@gmail.com>2010-07-04 10:15:59 (GMT)
commit874135b9ae86d631fc5d90d6af96529c421d91a4 (patch)
treef7b654f5abea175f1bcef79d1410bb77a06bea5f /Modules
parent8d386873c2b3c6fa6c630f1aa4de7cc7ae048fe4 (diff)
downloadcpython-874135b9ae86d631fc5d90d6af96529c421d91a4.zip
cpython-874135b9ae86d631fc5d90d6af96529c421d91a4.tar.gz
cpython-874135b9ae86d631fc5d90d6af96529c421d91a4.tar.bz2
Merged revisions 82527 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r82527 | mark.dickinson | 2010-07-04 11:15:11 +0100 (Sun, 04 Jul 2010) | 1 line Fix refleak in Modules/audioop.c. ........
Diffstat (limited to 'Modules')
-rw-r--r--Modules/audioop.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/Modules/audioop.c b/Modules/audioop.c
index d83ab5e..ce3fce3 100644
--- a/Modules/audioop.c
+++ b/Modules/audioop.c
@@ -804,10 +804,13 @@ audioop_tomono(PyObject *self, PyObject *args)
return 0;
cp = pcp.buf;
len = pcp.len;
- if (!audioop_check_parameters(len, size))
+ if (!audioop_check_parameters(len, size)) {
+ PyBuffer_Release(&pcp);
return NULL;
+ }
if (((len / size) & 1) != 0) {
PyErr_SetString(AudioopError, "not a whole number of frames");
+ PyBuffer_Release(&pcp);
return NULL;
}
@@ -821,8 +824,10 @@ audioop_tomono(PyObject *self, PyObject *args)
}
rv = PyBytes_FromStringAndSize(NULL, len/2);
- if ( rv == 0 )
+ if ( rv == 0 ) {
+ PyBuffer_Release(&pcp);
return 0;
+ }
ncp = (signed char *)PyBytes_AsString(rv);