app/testpmd: fix allocation check in MTR parsing
authorJasvinder Singh <jasvinder.singh@intel.com>
Mon, 22 Jan 2018 15:15:04 +0000 (15:15 +0000)
committerThomas Monjalon <thomas@monjalon.net>
Wed, 31 Jan 2018 22:34:47 +0000 (23:34 +0100)
commit0c36b7c4908865622a9eb8b1017eb96ba114e9e7
tree79617584a80869cee2b03270331846b46f9c8602
parent63531389d5790fe3d1045ecbf1112b0aa70e8046
app/testpmd: fix allocation check in MTR parsing

Malloc() function might return NULL due to insufficient space. Therefore,
check for handling memory allocation failure is added.

Coverity issue: 257039
Fixes: e63b50162aa3 ("app/testpmd: clean metering and policing commands")

Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
app/test-pmd/cmdline_mtr.c