diff options
author | Dave Airlie <airlied@redhat.com> | 2011-10-19 16:57:13 +0100 |
---|---|---|
committer | Jeremy Huddleston <jeremyhu@apple.com> | 2011-12-09 12:35:27 -0800 |
commit | df16b789aaf5fe7025e5661117477a5f6f9129ee (patch) | |
tree | 795aea89606bdf82976fb9aa8a8ef901ba9e8e2b | |
parent | befa8a3b836e8b5781491aff4e659ae856beb494 (diff) |
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>
(cherry picked from commit 1049139499d9132a20cd6d4d156fe9da9cddb6c2)
-rw-r--r-- | hw/xfree86/xaa/xaaGC.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/hw/xfree86/xaa/xaaGC.c b/hw/xfree86/xaa/xaaGC.c index 44d50e6b6..1bc35d9f3 100644 --- a/hw/xfree86/xaa/xaaGC.c +++ b/hw/xfree86/xaa/xaaGC.c @@ -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); |