From: Guido van Rossum Date: Fri, 1 Sep 2000 15:35:12 +0000 (+0000) Subject: Move the Py_DECREF(x) after the error: label so that we don't leak x X-Git-Tag: v2.0b1~80 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7c55404207378e662b88253f004041e1a4494f01;p=python Move the Py_DECREF(x) after the error: label so that we don't leak x when PyDict_SetItemString() fails. --- diff --git a/Modules/linuxaudiodev.c b/Modules/linuxaudiodev.c index 509823ed32..5b18f1606b 100644 --- a/Modules/linuxaudiodev.c +++ b/Modules/linuxaudiodev.c @@ -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; }