Commit 874135b9 authored by Mark Dickinson's avatar Mark Dickinson

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.
........
parent 8d386873
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment