From 3fff41ce7031f377aba7fc984cf419ca1f6a36a6 Mon Sep 17 00:00:00 2001 From: f4exb Date: Fri, 5 May 2017 09:30:45 +0200 Subject: [PATCH] cppcheck fixes --- plugins/samplesource/filesource/filesourcethread.cpp | 2 ++ sdrbase/mainwindow.cpp | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/samplesource/filesource/filesourcethread.cpp b/plugins/samplesource/filesource/filesourcethread.cpp index 1bf6af593..293d9c6ff 100644 --- a/plugins/samplesource/filesource/filesourcethread.cpp +++ b/plugins/samplesource/filesource/filesourcethread.cpp @@ -113,7 +113,9 @@ void FileSourceThread::setBuffer(std::size_t chunksize) else { qDebug() << "FileSourceThread::setBuffer: Re-allocate buffer"; + quint8 *buf = m_buf; m_buf = (quint8*) realloc((void*) m_buf, m_bufsize); + if (!m_buf) free(buf); } qDebug() << "FileSourceThread::setBuffer: size: " << m_bufsize diff --git a/sdrbase/mainwindow.cpp b/sdrbase/mainwindow.cpp index c68b55a47..efb45c3ce 100644 --- a/sdrbase/mainwindow.cpp +++ b/sdrbase/mainwindow.cpp @@ -388,7 +388,7 @@ void MainWindow::loadSettings() for(int i = 0; i < m_settings.getPresetCount(); ++i) { - addPresetToTree(m_settings.getPreset(i)); + ui->presetTree->setCurrentItem(addPresetToTree(m_settings.getPreset(i))); } }