rdp: fix leak when listener implantation fails

We've already allocated the listener by the time we hit this failure,
so we must exit through the path that frees it.

Co-authored-by: Steve Pronovost <spronovo@microsoft.com>
Co-authored-by: Brenton DeGeer <brdegeer@microsoft.com>
Signed-off-by: Hideyuki Nagase <hideyukn@microsoft.com>
Signed-off-by: Steve Pronovost <spronovo@microsoft.com>
Signed-off-by: Brenton DeGeer <brdegeer@microsoft.com>
This commit is contained in:
Hideyuki Nagase 2022-03-16 16:07:27 -05:00 committed by Daniel Stone
parent 23205b6b56
commit 516d2c0207

View file

@ -1342,7 +1342,7 @@ rdp_backend_create(struct weston_compositor *compositor,
}
if (rdp_implant_listener(b, b->listener) < 0)
goto err_compositor;
goto err_listener;
} else {
/* get the socket from RDP_FD var */
fd_str = getenv("RDP_FD");