VPP-1440: clean up coverity warnings
Change-Id: Ie315d4e83c0575d82aee0369ef50e8dd2dad6a2a
Signed-off-by: Dave Barach <dave@barachs.net>
diff --git a/src/plugins/memif/memif.c b/src/plugins/memif/memif.c
index 42325df..c01b8dc 100644
--- a/src/plugins/memif/memif.c
+++ b/src/plugins/memif/memif.c
@@ -682,8 +682,8 @@
vec_add1 (dir, '\0');
}
- if (((stat (dir, &file_stat) == -1) || (!S_ISDIR (file_stat.st_mode)))
- && (idx != 0))
+ if (((dir == 0) || (stat (dir, &file_stat) == -1)
+ || (!S_ISDIR (file_stat.st_mode))) && (idx != 0))
{
vec_free (dir);
return VNET_API_ERROR_INVALID_ARGUMENT;