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

Skip to content

Commit 7c55404

Browse files
committed
Move the Py_DECREF(x) after the error: label so that we don't leak x
when PyDict_SetItemString() fails.
1 parent 1688f37 commit 7c55404

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Modules/linuxaudiodev.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -440,8 +440,8 @@ initlinuxaudiodev(void)
440440
x = PyInt_FromLong((long) AFMT_S16_LE);
441441
if (x == NULL || PyDict_SetItemString(d, "AFMT_S16_LE", x) < 0)
442442
goto error;
443-
Py_DECREF(x);
444443

445444
error:
445+
Py_DECREF(x);
446446
return;
447447
}

0 commit comments

Comments
 (0)