[PATCH xserver 0/9] double frees in AddResource failure paths

Julien Cristau jcristau at debian.org
Mon Mar 7 22:20:25 UTC 2016


Hi,

prompted by Adam's recent fixes for unchecked AddResource, I've been
looking at the failure paths, and found a number of places where it
looks like we're freeing things twice (once as part of AddResource
itself calling the destroy function for the resource, and once in the
caller).  Plus more unchecked AddResource calls in xvmc and dri3.

Cheers,
Julien

Julien Cristau (9):
  xvmc: Fix unchecked AddResource
  dri3: return an error if AddResource fails
  glx: don't call pGlxDraw->destroy() if AddResource fails
  dmx/glxProxy: don't free the glx pixmap twice if AddResource fails
  modesetting: avoid double free if AddResource fails
  xwin: no need to free auth data if AddResource fails
  record: don't call RecordDeleteContext when AddResource fails
  render: free already allocated formats in PictureInit failure case
  xfixes: avoid double free if AddResource fails

 Xext/xvmc.c                           | 17 ++++++++++++++---
 dri3/dri3_request.c                   |  4 ++--
 glx/glxcmds.c                         |  9 ++-------
 hw/dmx/glxProxy/glxcmds.c             |  5 +----
 hw/xfree86/drivers/modesetting/dri2.c |  4 +---
 hw/xwin/winauth.c                     | 17 +++--------------
 record/record.c                       |  1 -
 render/picture.c                      |  3 +++
 xfixes/cursor.c                       |  4 +---
 9 files changed, 27 insertions(+), 37 deletions(-)

-- 
2.7.0



More information about the xorg-devel mailing list