iscsi: fix segfault in url parsing

If an invalid URL is specified iscsi_get_error(iscsi) is called
with iscsi == NULL.

Signed-off-by: Peter Lieven <pl@kamp.de>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
Peter Lieven 2012-11-15 15:42:06 +01:00 committed by Paolo Bonzini
parent 03a36f17d7
commit 8da1e18b0c

View File

@ -947,8 +947,7 @@ static int iscsi_open(BlockDriverState *bs, const char *filename, int flags)
iscsi_url = iscsi_parse_full_url(iscsi, filename);
if (iscsi_url == NULL) {
error_report("Failed to parse URL : %s %s", filename,
iscsi_get_error(iscsi));
error_report("Failed to parse URL : %s", filename);
ret = -EINVAL;
goto out;
}