[Xcb] [PATCH:xcb-util] Close leak in xcb_get_text_property_reply when reply->type == XCB_NONE
Alan Coopersmith
alan.coopersmith at oracle.com
Sun Jun 13 14:38:47 PDT 2010
Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>
---
icccm/icccm.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/icccm/icccm.c b/icccm/icccm.c
index 1c66a74..e620bde 100644
--- a/icccm/icccm.c
+++ b/icccm/icccm.c
@@ -60,8 +60,10 @@ xcb_get_text_property_reply(xcb_connection_t *c,
{
xcb_get_property_reply_t *reply = xcb_get_property_reply(c, cookie, e);
- if(!reply || reply->type == XCB_NONE)
+ if(!reply || reply->type == XCB_NONE) {
+ free(reply);
return 0;
+ }
prop->_reply = reply;
prop->encoding = prop->_reply->type;
--
1.5.6.5
More information about the Xcb
mailing list