forked from Mirror/frr
watchfrr: fix crash on missing optional argument
Fix `netns` command line handling for missing argument (it's optional). Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
This commit is contained in:
parent
e1b49f5da7
commit
b12bc77cd3
|
@ -1414,7 +1414,7 @@ int main(int argc, char **argv)
|
|||
} break;
|
||||
case OPTION_NETNS:
|
||||
netns_en = true;
|
||||
if (strchr(optarg, '/')) {
|
||||
if (optarg && strchr(optarg, '/')) {
|
||||
fprintf(stderr,
|
||||
"invalid network namespace name \"%s\" (may not contain slashes)\n",
|
||||
optarg);
|
||||
|
|
Loading…
Reference in a new issue