[PATCH] xwayland: free xcb reply value when malloc returns null

vivek vivek.ellur at samsung.com
Wed Apr 30 03:46:05 PDT 2014


Signed-off-by: vivek <vivek.ellur at samsung.com>
---
 xwayland/selection.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/xwayland/selection.c b/xwayland/selection.c
index b694477..d1f6361 100644
--- a/xwayland/selection.c
+++ b/xwayland/selection.c
@@ -186,8 +186,10 @@ weston_wm_get_selection_targets(struct weston_wm *wm)
 	}
 
 	source = malloc(sizeof *source);
-	if (source == NULL)
+	if (source == NULL) {
+		free(reply);
 		return;
+	}
 
 	wl_signal_init(&source->base.destroy_signal);
 	source->base.accept = data_source_accept;
-- 
1.7.9.5



More information about the wayland-devel mailing list