xaa: avoid possible freed pointer reuse in epilogue

If the pGCPriv->flags == 2, then we try to assign the freed pGCPriv->XAAOps
avoid this by clearing the flags in to be destroyed pGCPriv.

Reported by coverity.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
This commit is contained in:
Dave Airlie 2011-10-19 16:57:13 +01:00
parent 682c09a2ce
commit 1049139499

View File

@ -239,6 +239,7 @@ XAADestroyGC(GCPtr pGC)
free(pGCPriv->XAAOps);
free(pGCPriv->DashPattern);
pGCPriv->flags = 0;
(*pGC->funcs->DestroyGC)(pGC);
XAA_GC_FUNC_EPILOGUE (pGC);