UTILS: Check that an iscsi url was provided on the command line before strdup()ing it

This commit is contained in:
Ronnie Sahlberg
2013-07-20 09:01:38 -07:00
parent cc02faabb0
commit c172e12968
5 changed files with 15 additions and 5 deletions

View File

@@ -396,7 +396,9 @@ int main(int argc, char *argv[])
exit(0);
}
url = strdup(argv[optind]);
if (argv[optind] != NULL) {
url = strdup(argv[optind]);
}
if (url == NULL) {
fprintf(stderr, "You must specify the URL\n");
print_usage();