summaryrefslogtreecommitdiffstats
path: root/src/plugins/memif
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/memif')
-rw-r--r--src/plugins/memif/memif.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/plugins/memif/memif.c b/src/plugins/memif/memif.c
index 63f72a30de4..e8fb0e94a69 100644
--- a/src/plugins/memif/memif.c
+++ b/src/plugins/memif/memif.c
@@ -680,8 +680,10 @@ memif_socket_filename_add_del (u8 is_add, u32 sock_id, u8 * sock_filename)
}
/* check dir existance and access rights for effective user/group IDs */
- if (faccessat ( /* ignored */ -1, dir, F_OK | R_OK | W_OK, AT_EACCESS) <
- 0)
+ if ((dir == NULL)
+ ||
+ (faccessat ( /* ignored */ -1, dir, F_OK | R_OK | W_OK, AT_EACCESS)
+ < 0))
{
vec_free (dir);
return VNET_API_ERROR_INVALID_ARGUMENT;