pdump: check missing home environment variable
authorReshma Pattan <reshma.pattan@intel.com>
Fri, 24 Jun 2016 16:36:20 +0000 (17:36 +0100)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Mon, 27 Jun 2016 14:50:13 +0000 (16:50 +0200)
commitf3c1829130acde3b8969f013dbb14cebf7575863
tree326c8cd7b4640e8e74749f3637028584376be07b
parentbdd8dcc6e2886e80bed96e2e5c6f833791fef721
pdump: check missing home environment variable

inside pdump_get_socket_path(), getenv can return
a NULL pointer if the match for SOCKET_PATH_HOME is
not found in the environment. NULL check is added to
return -1 immediately. Since pdump_get_socket_path()
returns -1 now, wherever this function is called
there the return value is checked and error message
is logged.

Coverity issue: 127344, 127347

Fixes: 278f945402c5 ("pdump: add new library for packet capture")

Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
Acked-by: John McNamara <john.mcnamara@intel.com>
lib/librte_pdump/rte_pdump.c