From e7a10fedb4f3852949bea501b1d0a52a7d3db3d9 Mon Sep 17 00:00:00 2001 From: Doyoun Kang Date: Mon, 7 Feb 2022 09:26:27 +0900 Subject: [PATCH] e_comp_wl_data: fix build warning Change-Id: Ibee7d01c8e731ed23bad5ce649a47e4d8c7037b0 --- src/bin/e_comp_wl_data.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/bin/e_comp_wl_data.c b/src/bin/e_comp_wl_data.c index 7d2bcdf..a1bbb24 100644 --- a/src/bin/e_comp_wl_data.c +++ b/src/bin/e_comp_wl_data.c @@ -28,8 +28,8 @@ _e_comp_wl_data_offer_cb_accept(struct wl_client *client EINA_UNUSED, struct wl_ static Eina_Bool _e_comp_wl_dnd_offer_mediate(void *data, Ecore_Fd_Handler *handler) { - E_Comp_Wl_Data_Offer *offer; - char *p; + E_Comp_Wl_Data_Offer *offer = NULL; + char *p = NULL; int read_len = 0, write_len = 0; int source_fd = -1; @@ -41,6 +41,7 @@ _e_comp_wl_dnd_offer_mediate(void *data, Ecore_Fd_Handler *handler) if (offer->fd < 0) goto cleanup; p = (char *)calloc(sizeof(char), CLIPBOARD_CHUNK); + if (!p) goto cleanup; while ((read_len = read(source_fd, p, CLIPBOARD_CHUNK)) > 0) { -- 2.7.4