mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-30 22:20:21 +00:00
Avoid possible use of uninitialized variable
Errorcode doesn't get set if duppedfd is negative. So let's just issue an error and bail. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
4094e6b233
commit
4bdead6ad6
1 changed files with 4 additions and 0 deletions
|
@ -813,6 +813,10 @@ void DivelogsDeWebServices::downloadFinished()
|
|||
zip = zip_fdopen(duppedfd, 0, &errorcode);
|
||||
if (!zip)
|
||||
::close(duppedfd);
|
||||
} else {
|
||||
QMessageBox::critical(this, tr("Problem with download"),
|
||||
tr("The archive could not be opened:\n"));
|
||||
return;
|
||||
}
|
||||
#else
|
||||
struct zip *zip = zip_open(QFile::encodeName(zipFile.fileName()), 0, &errorcode);
|
||||
|
|
Loading…
Reference in a new issue