summaryrefslogtreecommitdiffstats
path: root/Modules/datetimemodule.c
diff options
context:
space:
mode:
authorMark Dickinson <dickinsm@gmail.com>2010-04-20 22:39:53 (GMT)
committerMark Dickinson <dickinsm@gmail.com>2010-04-20 22:39:53 (GMT)
commit56a60878264ec73f0c65501a4e9d1187cec803bd (patch)
tree4257438722a3020e355d1e2a0b15233fa5339201 /Modules/datetimemodule.c
parent7c186e2a18bf174afd5cccc8c35b7167d05f7e2a (diff)
downloadcpython-56a60878264ec73f0c65501a4e9d1187cec803bd.zip
cpython-56a60878264ec73f0c65501a4e9d1187cec803bd.tar.gz
cpython-56a60878264ec73f0c65501a4e9d1187cec803bd.tar.bz2
Fix memory leak.
Diffstat (limited to 'Modules/datetimemodule.c')
-rw-r--r--Modules/datetimemodule.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/Modules/datetimemodule.c b/Modules/datetimemodule.c
index 2896486..6ff7eb3 100644
--- a/Modules/datetimemodule.c
+++ b/Modules/datetimemodule.c
@@ -1914,10 +1914,9 @@ delta_remainder(PyObject *left, PyObject *right)
return NULL;
remainder = microseconds_to_delta(pyus_remainder);
- if (remainder == NULL) {
- Py_DECREF(divmod);
+ Py_DECREF(pyus_remainder);
+ if (remainder == NULL)
return NULL;
- }
return remainder;
}