app/testpmd: fix null pointer dereference
authorJasvinder Singh <jasvinder.singh@intel.com>
Fri, 27 Oct 2017 09:10:18 +0000 (10:10 +0100)
committerFerruh Yigit <ferruh.yigit@intel.com>
Tue, 7 Nov 2017 07:04:16 +0000 (07:04 +0000)
commit4f5dd001f77d01205566ed7e6349f60cd381621c
treeb2312a7d33b294dd80aa3a51399cb61ba6bf5933
parente28d4ee4f0d9aeb39ffc6e7b999b2dac30f4ab1a
app/testpmd: fix null pointer dereference

malloc() function might returns NULL when memory allocation fails
due to insufficient space. Therefore, check for handling memory allocation
failure is added.

Coverity issue: 198442,198444
Fixes: 996cb153af06 ("app/testpmd: add commands for TM nodes and hierarchy commit")

Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
app/test-pmd/cmdline_tm.c