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.
@@ -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);
