diff options
author | Dimitri van Heesch <dimitri@stack.nl> | 2014-08-31 14:52:19 (GMT) |
---|---|---|
committer | Dimitri van Heesch <dimitri@stack.nl> | 2014-08-31 14:52:19 (GMT) |
commit | 41887832b90698df95e8d222cdc0a541ae2f2284 (patch) | |
tree | 9ac6b9d9f07d8c5821fdd1b7d689db594a09414e /qtools | |
parent | b59edd279f887e55b162ae1b1c7bce4b2ca29dab (diff) | |
download | Doxygen-41887832b90698df95e8d222cdc0a541ae2f2284.zip Doxygen-41887832b90698df95e8d222cdc0a541ae2f2284.tar.gz Doxygen-41887832b90698df95e8d222cdc0a541ae2f2284.tar.bz2 |
Fixed a number of issues (resource leaks, uninitialized members, etc) found by coverity
Diffstat (limited to 'qtools')
-rw-r--r-- | qtools/qgstring.cpp | 2 | ||||
-rw-r--r-- | qtools/qthread.cpp | 1 |
2 files changed, 2 insertions, 1 deletions
diff --git a/qtools/qgstring.cpp b/qtools/qgstring.cpp index 85dd879..8b15675 100644 --- a/qtools/qgstring.cpp +++ b/qtools/qgstring.cpp @@ -209,7 +209,7 @@ QGString &QGString::operator+=( const QGString &s ) assert(memSize>=len1+len2+1); char *newData = memSize!=m_memSize ? (char*)realloc( m_data, memSize ) : m_data; m_memSize = memSize; - if (m_data) + if (newData) { m_data = newData; memcpy( m_data + len1, s, len2 + 1 ); diff --git a/qtools/qthread.cpp b/qtools/qthread.cpp index db2a0de..02c99f2 100644 --- a/qtools/qthread.cpp +++ b/qtools/qthread.cpp @@ -52,6 +52,7 @@ QThread::~QThread() QMutexLocker locker(&d->mutex); if (d->running && !d->finished) qWarning("QThread: Destroyed while thread is still running"); + delete d; } bool QThread::isFinished() const |