summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCedric BAIL <cedric@osg.samsung.com>2017-09-14 11:35:35 -0700
committerCedric BAIL <cedric@osg.samsung.com>2017-09-14 11:46:28 -0700
commita10a1fa641260adbb9571d3899404b4474629b19 (patch)
treefe963550224823c1cbdffe3a6ccb89d841c3ecdc /src
parent44c0199f4213a1b600569674ff3d6bc3d9395704 (diff)
ecore: update buffer size before allocation, not after.
Diffstat (limited to 'src')
-rw-r--r--src/lib/ecore/ecore_exe_posix.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/ecore/ecore_exe_posix.c b/src/lib/ecore/ecore_exe_posix.c
index 2c4862fb80..46a97d1461 100644
--- a/src/lib/ecore/ecore_exe_posix.c
+++ b/src/lib/ecore/ecore_exe_posix.c
@@ -708,20 +708,20 @@ _impl_ecore_exe_event_data_get(Ecore_Exe *obj,
708 if (count != 0) e->size = last; 708 if (count != 0) e->size = last;
709 if (flags & ECORE_EXE_PIPE_READ) 709 if (flags & ECORE_EXE_PIPE_READ)
710 { 710 {
711 exe->read_data_size = i - last;
711 exe->read_data_buf = malloc(exe->read_data_size); 712 exe->read_data_buf = malloc(exe->read_data_size);
712 if (exe->read_data_buf) 713 if (exe->read_data_buf)
713 { 714 {
714 exe->read_data_size = i - last;
715 memcpy(exe->read_data_buf, c, exe->read_data_size); 715 memcpy(exe->read_data_buf, c, exe->read_data_size);
716 } 716 }
717 else ERR("Out of memory in allocating exe pipe data"); 717 else ERR("Out of memory in allocating exe pipe data");
718 } 718 }
719 else 719 else
720 { 720 {
721 exe->error_data_size = i - last;
721 exe->error_data_buf = malloc(exe->error_data_size); 722 exe->error_data_buf = malloc(exe->error_data_size);
722 if (exe->error_data_buf) 723 if (exe->error_data_buf)
723 { 724 {
724 exe->error_data_size = i - last;
725 memcpy(exe->error_data_buf, c, exe->error_data_size); 725 memcpy(exe->error_data_buf, c, exe->error_data_size);
726 } 726 }
727 else ERR("Out of memory in allocating exe pipe data"); 727 else ERR("Out of memory in allocating exe pipe data");