Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a51791a

Browse files
committed
fix refleak in the error case
1 parent 676bf73 commit a51791a

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Modules/audioop.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1505,7 +1505,7 @@ audioop_lin2adpcm(PyObject *self, PyObject *args)
15051505
Py_ssize_t i;
15061506
int size, step, valpred, delta,
15071507
index, sign, vpdiff, diff;
1508-
PyObject *rv = NULL, *state, *str;
1508+
PyObject *rv = NULL, *state, *str = NULL;
15091509
int outputbuffer = 0, bufferstep;
15101510

15111511
if (!PyArg_ParseTuple(args, "y*iO:lin2adpcm",
@@ -1605,8 +1605,8 @@ audioop_lin2adpcm(PyObject *self, PyObject *args)
16051605
bufferstep = !bufferstep;
16061606
}
16071607
rv = Py_BuildValue("(O(ii))", str, valpred, index);
1608-
Py_DECREF(str);
16091608
exit:
1609+
Py_XDECREF(str);
16101610
PyBuffer_Release(&view);
16111611
return rv;
16121612
}

0 commit comments

Comments
 (0)