From f18082bbed0e67565a0c0fd4e088f7056e6796ed Mon Sep 17 00:00:00 2001 From: Giuseppe D'Angelo Date: Mon, 4 Sep 2023 20:14:21 +0200 Subject: [PATCH] QHostInfo::abortLookup: ignore -1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The id -1 is the one of a default-constructed QHostInfo (invalid). It's also returned by various codepaths to mean a lookup failure. Attemping to abort its lookup should simply be ignored. Change-Id: I0413dd248a890f57195e4f5b5baea011b6737102 Reviewed-by: MÃ¥rten Nordheim Reviewed-by: Thiago Macieira --- src/network/kernel/qhostinfo.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/network/kernel/qhostinfo.cpp b/src/network/kernel/qhostinfo.cpp index 54d72e6e07..9be6abced0 100644 --- a/src/network/kernel/qhostinfo.cpp +++ b/src/network/kernel/qhostinfo.cpp @@ -998,6 +998,9 @@ void QHostInfoLookupManager::abortLookup(int id) if (wasDeleted) return; + if (id == -1) + return; + #if QT_CONFIG(thread) // is postponed? delete and return for (int i = 0; i < postponedLookups.size(); i++) {