[Xcb] [PATCH 3/7] Don't blindly access the connection object in xpybCookie_dealloc; it may be NULL.

Alex Plotnick shrike at netaxs.com
Wed Feb 29 08:59:53 PST 2012


---
 src/cookie.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/cookie.c b/src/cookie.c
index 9994e51..3a9f70b 100644
--- a/src/cookie.c
+++ b/src/cookie.c
@@ -23,7 +23,7 @@ xpybCookie_new(PyTypeObject *self, PyObject *args, PyObject *kw)
 static void
 xpybCookie_dealloc(xpybCookie *self)
 {
-    if (self->conn->conn)
+    if (self->conn && self->conn->conn)
 	xcb_discard_reply(self->conn->conn, self->cookie.sequence);
 
     Py_CLEAR(self->reply_type);
-- 
1.7.6



More information about the Xcb mailing list