forked from enlightenment/efl
Fix potential memleak reported by klockwork.
Signed-off-by: Chris Michael <cp.michael@samsung.com>
This commit is contained in:
parent
23fc3b3da7
commit
964f4769ae
|
@ -620,7 +620,11 @@ _ecore_wl_dnd_selection_data_read(void *data, Ecore_Fd_Handler *fd_handler EINA_
|
|||
else
|
||||
{
|
||||
event->data = malloc(len + 1);
|
||||
if (!event->data) return ECORE_CALLBACK_CANCEL;
|
||||
if (!event->data)
|
||||
{
|
||||
free(event);
|
||||
return ECORE_CALLBACK_CANCEL;
|
||||
}
|
||||
strncpy(event->data, buffer, len);
|
||||
event->data[len] = '\0';
|
||||
event->len = len;
|
||||
|
|
Loading…
Reference in New Issue