From a24ce4ccc0ace9aa0397472f5f4889e5756d8381 Mon Sep 17 00:00:00 2001 From: Nikolai Kondrashov Date: Tue, 8 Sep 2020 15:57:14 +0300 Subject: Free invalid values 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. --- jq.pyx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/jq.pyx b/jq.pyx index bcfb457..083faa7 100644 --- a/jq.pyx +++ b/jq.pyx @@ -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: @@ -274,6 +275,7 @@ cdef class _ResultIterator(object): jv_free(error_message) raise ValueError(u"parse error: " + message) else: + jv_free(value) raise StopIteration() -- cgit v1.2.3