libX11/libX11-1.1.4-xcb-xreply-leak.patch
Adam Jackson 76dfd6e153 - libX11-1.1.4-xcb-xreply-leak.patch: Fix a leak when the client has a
non-fatal error handler. (mclasen, fdo #17616)
2008-09-17 14:57:27 +00:00

38 lines
840 B
Diff

--- libX11-1.1.4/src/xcb_io.c 2008-03-06 15:45:06.000000000 -0500
+++ hacked/src/xcb_io.c 2008-09-17 00:40:57.000000000 -0400
@@ -396,15 +396,18 @@
{
case X_LookupColor:
case X_AllocNamedColor:
+ free(error);
return 0;
}
break;
case BadFont:
if(err->majorCode == X_QueryFont)
+ free(error);
return 0;
break;
case BadAlloc:
case BadAccess:
+ free(error);
return 0;
}
@@ -413,10 +416,13 @@
* want to suppress the error.
*/
for(ext = dpy->ext_procs; ext; ext = ext->next)
- if(ext->error && ext->error(dpy, err, &ext->codes, &ret_code))
+ if(ext->error && ext->error(dpy, err, &ext->codes, &ret_code)) {
+ free(error);
return ret_code;
+ }
- _XError(dpy, (xError *) error);
+ _XError(dpy, err);
+ free(error);
return 0;
}