summaryrefslogtreecommitdiff
path: root/src/lib/ecore_wayland/ecore_wl_dnd.c
diff options
context:
space:
mode:
authorChris Michael <cp.michael@samsung.com>2013-05-29 13:24:49 +0100
committerChris Michael <cp.michael@samsung.com>2013-05-29 13:24:49 +0100
commit964f4769ae02287f7f1096b2dde31c958a252b8a (patch)
tree8ee3fde569b8666e365d9627ab29154d8a0802b8 /src/lib/ecore_wayland/ecore_wl_dnd.c
parent23fc3b3da7f15de7821d4915c3b7398c73e3a048 (diff)
Fix potential memleak reported by klockwork.
Signed-off-by: Chris Michael <cp.michael@samsung.com>
Diffstat (limited to 'src/lib/ecore_wayland/ecore_wl_dnd.c')
-rw-r--r--src/lib/ecore_wayland/ecore_wl_dnd.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/lib/ecore_wayland/ecore_wl_dnd.c b/src/lib/ecore_wayland/ecore_wl_dnd.c
index 444e1e10a5..f5849dcf9c 100644
--- a/src/lib/ecore_wayland/ecore_wl_dnd.c
+++ b/src/lib/ecore_wayland/ecore_wl_dnd.c
@@ -620,7 +620,11 @@ _ecore_wl_dnd_selection_data_read(void *data, Ecore_Fd_Handler *fd_handler EINA_
620 else 620 else
621 { 621 {
622 event->data = malloc(len + 1); 622 event->data = malloc(len + 1);
623 if (!event->data) return ECORE_CALLBACK_CANCEL; 623 if (!event->data)
624 {
625 free(event);
626 return ECORE_CALLBACK_CANCEL;
627 }
624 strncpy(event->data, buffer, len); 628 strncpy(event->data, buffer, len);
625 event->data[len] = '\0'; 629 event->data[len] = '\0';
626 event->len = len; 630 event->len = len;