]> granicus.if.org Git - python/commitdiff
fix refleak in the error case
authorBenjamin Peterson <benjamin@python.org>
Mon, 13 Jan 2014 14:20:53 +0000 (09:20 -0500)
committerBenjamin Peterson <benjamin@python.org>
Mon, 13 Jan 2014 14:20:53 +0000 (09:20 -0500)
Modules/audioop.c

index bae4f2687e678c9e3d9fce76bdf53f508e9d6cac..f8bb18acf98783a1711060d499f3158a640a1ecd 100644 (file)
@@ -1505,7 +1505,7 @@ audioop_lin2adpcm(PyObject *self, PyObject *args)
     Py_ssize_t i;
     int size, step, valpred, delta,
         index, sign, vpdiff, diff;
-    PyObject *rv = NULL, *state, *str;
+    PyObject *rv = NULL, *state, *str = NULL;
     int outputbuffer = 0, bufferstep;
 
     if (!PyArg_ParseTuple(args, "y*iO:lin2adpcm",
@@ -1605,8 +1605,8 @@ audioop_lin2adpcm(PyObject *self, PyObject *args)
         bufferstep = !bufferstep;
     }
     rv = Py_BuildValue("(O(ii))", str, valpred, index);
-    Py_DECREF(str);
   exit:
+    Py_XDECREF(str);
     PyBuffer_Release(&view);
     return rv;
 }