cmdline: check initialization error
authorMarcin Kerlin <marcinx.kerlin@intel.com>
Tue, 17 May 2016 08:36:57 +0000 (10:36 +0200)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Thu, 19 May 2016 12:40:12 +0000 (14:40 +0200)
commit661d97ba0b56897c0eb21e61a8b12a5cc227f07e
tree37ba771ffdeb713443849a9e02a015a8f8624a9a
parente114696200ce29439c8ab82aa1279d5ca30644f0
cmdline: check initialization error

The value returned by rdline_init() was not checked in cmdline_new().
On error, free the allocated memory and return NULL.

This condition should not happen today, but it's safer to do the check
in case rdline_init() is updated.

Coverity issue: 13204
Fixes: af75078fece3 ("first public release")

Signed-off-by: Marcin Kerlin <marcinx.kerlin@intel.com>
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
lib/librte_cmdline/cmdline.c