liboffloadmic: Add missed checks for malloc and strdup return values
authorIlya Verbin <ilya.verbin@intel.com>
Thu, 8 Oct 2015 19:04:43 +0000 (19:04 +0000)
committerIlya Verbin <iverbin@gcc.gnu.org>
Thu, 8 Oct 2015 19:04:43 +0000 (19:04 +0000)
commit6fd2e66a091023edaf55d874189ab63ec8568398
treecc473b0ce992a6b6a8004d8e0c64c388b612ddd0
parentbc8642d6cef0782bc3181ade2ba577e53bcefc15
liboffloadmic: Add missed checks for malloc and strdup return values

liboffloadmic/
* runtime/offload_engine.cpp (Engine::init_process): Use strdup instead
of sizeof+malloc+sprintf, check for return value.
* runtime/offload_env.cpp (MicEnvVar::get_env_var_kind): Check for
strdup return value.
* runtime/offload_host.cpp (__offload_init_library_once): Check for
strdup return value.  Fix size calculation of COI_HOST_THREAD_AFFINITY.
* runtime/emulator/coi_device.cpp (COIProcessWaitForShutdown): Check for
malloc return value.

From-SVN: r228622
liboffloadmic/ChangeLog
liboffloadmic/runtime/emulator/coi_device.cpp
liboffloadmic/runtime/offload_engine.cpp
liboffloadmic/runtime/offload_env.cpp
liboffloadmic/runtime/offload_host.cpp