summaryrefslogtreecommitdiff
path: root/jq.pyx
diff options
context:
space:
mode:
authorNikolai Kondrashov <Nikolai.Kondrashov@redhat.com>2020-09-08 15:57:14 +0300
committerNikolai Kondrashov <Nikolai.Kondrashov@redhat.com>2020-09-09 13:45:15 +0300
commita24ce4ccc0ace9aa0397472f5f4889e5756d8381 (patch)
tree81467fc095f1316085e60f5032c838ee065f9d7b /jq.pyx
parent52564dd2ba555b26048f54a1f3e9708fedefbb42 (diff)
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.
Diffstat (limited to 'jq.pyx')
-rw-r--r--jq.pyx2
1 files changed, 2 insertions, 0 deletions
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()