summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Modules/_datetimemodule.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/Modules/_datetimemodule.c b/Modules/_datetimemodule.c
index a89e0ec..1eace71 100644
--- a/Modules/_datetimemodule.c
+++ b/Modules/_datetimemodule.c
@@ -4462,6 +4462,9 @@ datetime_subtract(PyObject *left, PyObject *right)
delta_us = DATE_GET_MICROSECOND(left) -
DATE_GET_MICROSECOND(right);
result = new_delta(delta_d, delta_s, delta_us, 1);
+ if (result == NULL)
+ return NULL;
+
if (offdiff != NULL) {
PyObject *temp = result;
result = delta_subtract(result, offdiff);