Skip to content

Commit

Permalink
Fix memory leak in cases where there are unused characters in the tim…
Browse files Browse the repository at this point in the history
…estamp
  • Loading branch information
movermeyer committed Jun 29, 2021
1 parent 7936823 commit de3cf00
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions module.c
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,8 @@ _parse(PyObject *self, PyObject *args, int parse_any_tzinfo, int rfc3339_only)
/* Make sure that there is no more to parse. */
if (*c != '\0') {
PyErr_Format(PyExc_ValueError, "unconverted data remains: '%s'", c);
if (tzinfo != Py_None && tzinfo != utc)
Py_DECREF(tzinfo);
return NULL;
}

Expand Down

0 comments on commit de3cf00

Please sign in to comment.