From 24eb53e207c115dc5b5463d1ab13d19a2eb6ac2e Mon Sep 17 00:00:00 2001 From: Ondrej Holy Date: Mon, 20 Aug 2018 09:33:42 +0200 Subject: [PATCH] uwac: Fix leak found by covscan leaked_storage: Variable "data" going out of scope leaks the storage it points to. copy_paste_error: "opaque_region" in "w->opaque_region" looks like a copy-paste error. --- uwac/libuwac/uwac-window.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/uwac/libuwac/uwac-window.c b/uwac/libuwac/uwac-window.c index 343c1ef24..324c520d3 100644 --- a/uwac/libuwac/uwac-window.c +++ b/uwac/libuwac/uwac-window.c @@ -331,6 +331,7 @@ int UwacWindowShmAllocBuffers(UwacWindow* w, int nbuffers, int allocSize, uint32 if (!pool) { + munmap(data, allocSize * nbuffers); ret = UWAC_ERROR_NOMEMORY; goto error_mmap; } @@ -500,7 +501,7 @@ UwacReturnCode UwacDestroyWindow(UwacWindow** pwindow) wl_region_destroy(w->opaque_region); if (w->input_region) - wl_region_destroy(w->opaque_region); + wl_region_destroy(w->input_region); wl_surface_destroy(w->surface); wl_list_remove(&w->link);