From d60fbd469ea04148f06a3d4fc5e4ed94bb29741c Mon Sep 17 00:00:00 2001 From: Skip Montanaro Date: Wed, 15 Jun 2005 01:33:30 +0000 Subject: [PATCH] Leak fix from Michael Hudson. Fix memory leak when dialect doesn't validate. Closes 1220242. --- Modules/_csv.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Modules/_csv.c b/Modules/_csv.c index 638079293ca..79870c04908 100644 --- a/Modules/_csv.c +++ b/Modules/_csv.c @@ -416,7 +416,9 @@ dialect_new(PyTypeObject *type, PyObject *args, PyObject *kwargs) } ret = (PyObject *)self; + Py_INCREF(self); err: + Py_XDECREF(self); Py_XDECREF(dialect); Py_XDECREF(delimiter); Py_XDECREF(doublequote);