diff options
author | Andy Shaw <andy.shaw@digia.com> | 2015-03-16 13:10:27 +0100 |
---|---|---|
committer | Andy Shaw <andy.shaw@digia.com> | 2015-03-16 18:13:24 +0000 |
commit | bb5d287cc3eb68e1e46e5c3eb0a2c3991900354d (patch) | |
tree | 98d252e63594e142d2f6b23c49f221eda7ba7ffa /src/corelib/kernel/qsharedmemory_systemv.cpp | |
parent | 60ac5957d34b673c8e851c7b5b01b9cc0b1f00d8 (diff) |
Windows: Don't cause a malloc before calling GetLastError()
When creating a string it would cause a malloc which would reset
GetLastError() so we need to ensure that GetLastError() is the first thing
it calls if a Windows API call fails.
Task-number: QTBUG-27765
Change-Id: I5cc4ce59aa1f03a0ec978fe54949a7931a225d52
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Diffstat (limited to 'src/corelib/kernel/qsharedmemory_systemv.cpp')
-rw-r--r-- | src/corelib/kernel/qsharedmemory_systemv.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/corelib/kernel/qsharedmemory_systemv.cpp b/src/corelib/kernel/qsharedmemory_systemv.cpp index 953747e41d..29fee12c0b 100644 --- a/src/corelib/kernel/qsharedmemory_systemv.cpp +++ b/src/corelib/kernel/qsharedmemory_systemv.cpp @@ -149,7 +149,7 @@ bool QSharedMemoryPrivate::create(int size) // create if (-1 == shmget(unix_key, size, 0600 | IPC_CREAT | IPC_EXCL)) { - QString function = QLatin1String("QSharedMemory::create"); + const QLatin1String function("QSharedMemory::create"); switch (errno) { case EINVAL: errorString = QSharedMemory::tr("%1: system-imposed size restrictions").arg(QLatin1String("QSharedMemory::handle")); @@ -199,7 +199,7 @@ bool QSharedMemoryPrivate::detach() { // detach from the memory segment if (-1 == shmdt(memory)) { - QString function = QLatin1String("QSharedMemory::detach"); + const QLatin1String function("QSharedMemory::detach"); switch (errno) { case EINVAL: errorString = QSharedMemory::tr("%1: not attached").arg(function); |