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>
dev
Hideyuki Nagase 3 years ago committed by Daniel Stone
parent 23205b6b56
commit 516d2c0207
  1. 2
      libweston/backend-rdp/rdp.c

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

Loading…
Cancel
Save