QNetworkReplyImplPrivate - potential nullptr dereference
Found by Coverity, CID 11351. If we check 'if (backend)' at one line, not clear why we do 'if (bakcend->canResume())' two lines above without any test. Also, 'delete backend' is noop if backend is nullptr, so ... even this 'if (backend)' is ... not needed. Change-Id: I7a46ce04baeb9251debb7b246954911df58880ca Reviewed-by: Edward Welbourne <edward.welbourne@theqtcompany.com> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>bb10
parent
cc1a28d07e
commit
d31bc5cbf9
|
|
@ -1100,21 +1100,17 @@ bool QNetworkReplyImplPrivate::migrateBackend()
|
|||
return true;
|
||||
|
||||
// Backend does not support resuming download.
|
||||
if (!backend->canResume())
|
||||
if (backend && !backend->canResume())
|
||||
return false;
|
||||
|
||||
state = QNetworkReplyPrivate::Reconnecting;
|
||||
|
||||
if (backend) {
|
||||
delete backend;
|
||||
backend = 0;
|
||||
}
|
||||
|
||||
cookedHeaders.clear();
|
||||
rawHeaders.clear();
|
||||
|
||||
preMigrationDownloaded = bytesDownloaded;
|
||||
|
||||
delete backend;
|
||||
backend = manager->d_func()->findBackend(operation, request);
|
||||
|
||||
if (backend) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue