[Xcb-commit] xcb/src xcb_ext.c,1.5,1.6

Jamey Sharp xcb-commit at lists.freedesktop.org
Fri Jul 22 14:11:00 EST 2005


Update of /cvs/xcb/xcb/src
In directory gabe:/tmp/cvs-serv10309/src

Modified Files:
	xcb_ext.c 
Log Message:
Fix memory leak reported by Carl Worth (thanks Carl!).


Index: xcb_ext.c
===================================================================
RCS file: /cvs/xcb/xcb/src/xcb_ext.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- xcb_ext.c	10 Apr 2005 01:03:31 -0000	1.5
+++ xcb_ext.c	22 Jul 2005 04:10:58 -0000	1.6
@@ -66,6 +66,14 @@
     return data;
 }
 
+static void free_lazyreply(void *p)
+{
+    lazyreply *data = p;
+    if(data->tag == LAZY_FORCED)
+        free(data->value.reply);
+    free(data);
+}
+
 /* Public interface */
 
 /* Do not free the returned XCBQueryExtensionRep - on return, it's aliased
@@ -110,5 +118,5 @@
 void _xcb_ext_destroy(XCBConnection *c)
 {
     pthread_mutex_destroy(&c->ext.lock);
-    _xcb_map_delete(c->ext.extensions, free);
+    _xcb_map_delete(c->ext.extensions, free_lazyreply);
 }



More information about the xcb-commit mailing list