summaryrefslogtreecommitdiff
path: root/src/lib/ecore
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2017-07-24 16:59:53 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2017-07-24 16:59:53 +0900
commitfe6dc2000d432f5bc9cdaf42bcd67e0dd6ba6393 (patch)
tree9f06d355381b9418ef5f70f26fc18cfdbfa1c033 /src/lib/ecore
parent829d0bc3f993a0346171844486f1d021465c4055 (diff)
ecore exe - pisix - handle malloc fails
handle malloc fails better @fix
Diffstat (limited to 'src/lib/ecore')
-rw-r--r--src/lib/ecore/ecore_exe_posix.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/lib/ecore/ecore_exe_posix.c b/src/lib/ecore/ecore_exe_posix.c
index 9624f80be4..4f5d125944 100644
--- a/src/lib/ecore/ecore_exe_posix.c
+++ b/src/lib/ecore/ecore_exe_posix.c
@@ -707,15 +707,23 @@ _impl_ecore_exe_event_data_get(Ecore_Exe *obj,
707 if (count != 0) e->size = last; 707 if (count != 0) e->size = last;
708 if (flags & ECORE_EXE_PIPE_READ) 708 if (flags & ECORE_EXE_PIPE_READ)
709 { 709 {
710 exe->read_data_size = i - last;
711 exe->read_data_buf = malloc(exe->read_data_size); 710 exe->read_data_buf = malloc(exe->read_data_size);
712 memcpy(exe->read_data_buf, c, exe->read_data_size); 711 if (exe->read_data_buf)
712 {
713 exe->read_data_size = i - last;
714 memcpy(exe->read_data_buf, c, exe->read_data_size);
715 }
716 else ERR("Out of memory in allocating exe pipe data");
713 } 717 }
714 else 718 else
715 { 719 {
716 exe->error_data_size = i - last;
717 exe->error_data_buf = malloc(exe->error_data_size); 720 exe->error_data_buf = malloc(exe->error_data_size);
718 memcpy(exe->error_data_buf, c, exe->error_data_size); 721 if (exe->error_data_buf)
722 {
723 exe->error_data_size = i - last;
724 memcpy(exe->error_data_buf, c, exe->error_data_size);
725 }
726 else ERR("Out of memory in allocating exe pipe data");
719 } 727 }
720 } 728 }
721 if (count == 0) /* No lines to send, cancel the event. */ 729 if (count == 0) /* No lines to send, cancel the event. */