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

@@ -380,7 +380,9 @@ int main(int argc, char *argv[])
memset(&state, 0, sizeof(state));
url = strdup(argv[optind]);
if (argv[optind] != NULL) {
url = strdup(argv[optind]);
}
if (url == NULL) {
fprintf(stderr, "You must specify iscsi target portal.\n");
print_usage();