Add checks for memory allocation failures

Signed-off-by: Mahavir Jain <mahavir@espressif.com>
2 files changed