Skip to content

Commit

Permalink
Free invalid values
Browse files Browse the repository at this point in the history
Even though "message-less" invalid values don't technically need
"freeing", doing so is supported by the library, and could be good for
uniformity and future-proofing.
  • Loading branch information
spbnick committed Sep 9, 2020
1 parent 0de093f commit e1eeb1e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions jq.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,7 @@ cdef class _ResultIterator(object):
jv_free(error_message)
raise ValueError(message)
else:
jv_free(result)
self._ready = False

cdef bint _ready_next_input(self) except 1:
Expand All @@ -274,6 +275,7 @@ cdef class _ResultIterator(object):
jv_free(error_message)
raise ValueError(u"parse error: " + message)
else:
jv_free(value)
raise StopIteration()


Expand Down

0 comments on commit e1eeb1e

Please sign in to comment.