From c57c920c266e761ac7940aa3f48672dbdbada965 Mon Sep 17 00:00:00 2001 From: Praveen Chavan Date: Wed, 16 Sep 2015 11:20:00 -0700 Subject: [PATCH] libgui: assign handle to NULL after free to avoid use-after-free situations Change-Id: If9c09f509bc55795856302e5ca34470df019c622 --- libs/ui/GraphicBuffer.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/libs/ui/GraphicBuffer.cpp b/libs/ui/GraphicBuffer.cpp index e55db30f8..0d7772724 100644 --- a/libs/ui/GraphicBuffer.cpp +++ b/libs/ui/GraphicBuffer.cpp @@ -112,6 +112,7 @@ void GraphicBuffer::free_handle() GraphicBufferAllocator& allocator(GraphicBufferAllocator::get()); allocator.free(handle); } + handle = NULL; mWrappedBuffer = 0; }