summaryrefslogtreecommitdiff
path: root/vmwgfx/vmwgfx_overlay.c
diff options
context:
space:
mode:
authorThomas Hellstrom <thellstrom@vmware.com>2018-11-27 16:20:32 +0100
committerThomas Hellstrom <thellstrom@vmware.com>2018-11-28 09:25:39 +0100
commit4ec3d67da829f4e7a35ab08427002b9d7e4e5f4b (patch)
treea5fae4115dff22fdee176464fb7ac9da91f92a9d /vmwgfx/vmwgfx_overlay.c
parent71c85a70f1c5ff93e931181d0858af22cba231ec (diff)
vmwgfx: Fix XVideo memory leaks
We were not properly freeing the port privates. In order to access those at CloseScreen time, don't free the adaptor pointers at XV screen init, but hold on to them until CloseScreen. Also properly free the new_adaptors pointer. Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com> Reviewed-by: Brian Paul <brianp@vmware.com>
Diffstat (limited to 'vmwgfx/vmwgfx_overlay.c')
-rw-r--r--vmwgfx/vmwgfx_overlay.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/vmwgfx/vmwgfx_overlay.c b/vmwgfx/vmwgfx_overlay.c
index c35cebd..94d738c 100644
--- a/vmwgfx/vmwgfx_overlay.c
+++ b/vmwgfx/vmwgfx_overlay.c
@@ -258,15 +258,12 @@ vmwgfx_overlay_port_create(int drm_fd, ScreenPtr pScreen)
}
void
-vmw_video_free_adaptor(XF86VideoAdaptorPtr adaptor, Bool free_ports)
+vmw_video_free_adaptor(XF86VideoAdaptorPtr adaptor)
{
- if (free_ports) {
- int i;
+ int i;
- for(i=0; i<adaptor->nPorts; ++i) {
- free(adaptor->pPortPrivates[i].ptr);
- }
- }
+ for (i = 0; i < adaptor->nPorts; ++i)
+ free(adaptor->pPortPrivates[i].ptr);
free(adaptor->pPortPrivates);
xf86XVFreeVideoAdaptorRec(adaptor);