summaryrefslogtreecommitdiffstats
path: root/Modules/_csv.c
diff options
context:
space:
mode:
authorSkip Montanaro <skip@pobox.com>2005-06-15 01:33:30 (GMT)
committerSkip Montanaro <skip@pobox.com>2005-06-15 01:33:30 (GMT)
commitd60fbd469ea04148f06a3d4fc5e4ed94bb29741c (patch)
treeb98ce348132e913f8ed80ed83e2f3f37f13f2df6 /Modules/_csv.c
parentd6d2c0d08b9e94315f47db00006a4b0474f6949c (diff)
downloadcpython-d60fbd469ea04148f06a3d4fc5e4ed94bb29741c.zip
cpython-d60fbd469ea04148f06a3d4fc5e4ed94bb29741c.tar.gz
cpython-d60fbd469ea04148f06a3d4fc5e4ed94bb29741c.tar.bz2
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 6380792..79870c0 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);