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:
Dirk Hohndel 2015-06-22 22:23:04 -07:00
parent 4094e6b233
commit 4bdead6ad6

View file

@ -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);