summaryrefslogtreecommitdiffstats
path: root/src/network/kernel/qhostinfo_unix.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/network/kernel/qhostinfo_unix.cpp')
-rw-r--r--src/network/kernel/qhostinfo_unix.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/network/kernel/qhostinfo_unix.cpp b/src/network/kernel/qhostinfo_unix.cpp
index 3271debd2c..f5d7166075 100644
--- a/src/network/kernel/qhostinfo_unix.cpp
+++ b/src/network/kernel/qhostinfo_unix.cpp
@@ -320,6 +320,8 @@ QString QHostInfo::localDomainName()
if (local_res_ninit) {
// using thread-safe version
res_state_ptr state = res_state_ptr(qMalloc(sizeof(*state)));
+ if (!state)
+ qBadAlloc();
memset(state, 0, sizeof(*state));
local_res_ninit(state);
QString domainName = QUrl::fromAce(state->defdname);