From 516d2c020784e71a392553c63f1526e187aada75 Mon Sep 17 00:00:00 2001 From: Hideyuki Nagase Date: Wed, 16 Mar 2022 16:07:27 -0500 Subject: [PATCH] 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 Co-authored-by: Brenton DeGeer Signed-off-by: Hideyuki Nagase Signed-off-by: Steve Pronovost Signed-off-by: Brenton DeGeer --- libweston/backend-rdp/rdp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libweston/backend-rdp/rdp.c b/libweston/backend-rdp/rdp.c index 35c18600..358302f5 100644 --- a/libweston/backend-rdp/rdp.c +++ b/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");