summaryrefslogtreecommitdiffstats
path: root/cython/property_list_client.pxi
diff options
context:
space:
mode:
Diffstat (limited to 'cython/property_list_client.pxi')
-rw-r--r--cython/property_list_client.pxi12
1 files changed, 10 insertions, 2 deletions
diff --git a/cython/property_list_client.pxi b/cython/property_list_client.pxi
index 874f2b5..2f9ce76 100644
--- a/cython/property_list_client.pxi
+++ b/cython/property_list_client.pxi
@@ -4,8 +4,16 @@ cdef class PropertyListClient(Base):
self.handle_error(self._send(n._c_node))
cpdef object receive(self):
- cdef plist.plist_t c_node = NULL
- self.handle_error(self._receive(&c_node))
+ cdef:
+ plist.plist_t c_node = NULL
+ int16_t err
+ err = self._receive(&c_node)
+ try:
+ self.handle_error(err)
+ except BaseError, e:
+ if c_node != NULL:
+ plist_free(c_node)
+ raise
return plist.plist_t_to_node(c_node)