Move the Py_DECREF(x) after the error: label so that we don't leak x

when PyDict_SetItemString() fails.
This commit is contained in:
Guido van Rossum 2000-09-01 15:35:12 +00:00
parent 1688f378cb
commit 7c55404207
1 changed files with 1 additions and 1 deletions

View File

@ -440,8 +440,8 @@ initlinuxaudiodev(void)
x = PyInt_FromLong((long) AFMT_S16_LE);
if (x == NULL || PyDict_SetItemString(d, "AFMT_S16_LE", x) < 0)
goto error;
Py_DECREF(x);
error:
Py_DECREF(x);
return;
}