Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sheep: handle OOM error gracefully when receive SD_OP_GET_OBJ_LIST
When a sheep receives SD_OP_GET_OBJ_LIST request, xrealloc is called to allocate memory for object list which is being sent to the requesting. However, xrealloc panics if out-of-memory (OOM) error occurs. In this case, the sheep goes down. This is not good for stable running. This commit lets sheep handle OOM error gracefully when it receives SD_OP_GET_OBJ_LIST. If OOM error occurs, sheep returns SD_RES_NO_MEM. This is realized by using realloc instead of xrealloc (note "x") and check whether errno is set to ENOMEM or not. Signed-off-by: Takashi Menjo <menjo.takashi@lab.ntt.co.jp>
- Loading branch information