freach / udatetime

Fast RFC3339 compliant Python date-time library
Other
241 stars 27 forks source link

Memory leak in from_string #24

Closed ldanielburr closed 6 years ago

ldanielburr commented 6 years ago

udatetime version 0.13 leaks memory when calling from_string.

Example (Python 2.7):

import udatetime

s = u"2008-09-08T22:47:31-07:00"
while True:
    t = udatetime.from_string(s)

The pure python version of from_string does not leak, only the C-extension (from_rfc3339_string) does.

elimossrosenberg commented 6 years ago

Yep, The strdup call on line 124 of rfc3339.c should be free-d similar to the way to the way that the strdup call on line 219 is free-d.

Otherwise, every invocation appears to leak memory

freach commented 6 years ago

Thank you @ldanielburr and @elimossrosenberg Issue is fixed and fix will be released in 0.0.15