diff --git a/src/tincctl.c b/src/tincctl.c index 24359ab7..ca354bc0 100644 --- a/src/tincctl.c +++ b/src/tincctl.c @@ -192,7 +192,7 @@ static bool parse_options(int argc, char **argv) { /* netname "." is special: a "top-level name" */ - if(!strcmp(netname, ".")) { + if(netname && !strcmp(netname, ".")) { free(netname); netname = NULL; } diff --git a/src/tincd.c b/src/tincd.c index 85aee39f..9879ecb6 100644 --- a/src/tincd.c +++ b/src/tincd.c @@ -231,7 +231,7 @@ static bool parse_options(int argc, char **argv) { /* netname "." is special: a "top-level name" */ - if(!strcmp(netname, ".")) { + if(netname && !strcmp(netname, ".")) { free(netname); netname = NULL; }