aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSkip Montanaro <skip@pobox.com>2005-06-15 01:33:30 +0000
committerSkip Montanaro <skip@pobox.com>2005-06-15 01:33:30 +0000
commitd60fbd469ea04148f06a3d4fc5e4ed94bb29741c (patch)
treeb98ce348132e913f8ed80ed83e2f3f37f13f2df6 /Modules/_csv.c
parentMore tweaks for C++ support. Still doesn't seem to break anything:-) (diff)
downloadcpython-d60fbd469ea04148f06a3d4fc5e4ed94bb29741c.tar.gz
cpython-d60fbd469ea04148f06a3d4fc5e4ed94bb29741c.tar.bz2
cpython-d60fbd469ea04148f06a3d4fc5e4ed94bb29741c.zip
Leak fix from Michael Hudson. Fix memory leak when dialect doesn't
validate. Closes 1220242.
Diffstat (limited to 'Modules/_csv.c')
-rw-r--r--Modules/_csv.c2
1 files changed, 2 insertions, 0 deletions
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);