1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-16 13:21:50 -05:00

Web API and related: fixed memory leaks (3)

This commit is contained in:
f4exb 2018-02-14 19:59:19 +01:00
parent e9c8dad663
commit c0eed06b69
2 changed files with 8 additions and 1 deletions

View File

@ -828,11 +828,13 @@ int WebAPIAdapterGUI::devicesetDeviceSettingsPutPatch(
{ {
if (response.getTx() != 0) if (response.getTx() != 0)
{ {
error.init();
*error.getMessage() = QString("Rx device found but Tx device requested"); *error.getMessage() = QString("Rx device found but Tx device requested");
return 400; return 400;
} }
if (deviceSet->m_deviceSourceAPI->getHardwareId() != *response.getDeviceHwType()) if (deviceSet->m_deviceSourceAPI->getHardwareId() != *response.getDeviceHwType())
{ {
error.init();
*error.getMessage() = QString("Device mismatch. Found %1 input").arg(deviceSet->m_deviceSourceAPI->getHardwareId()); *error.getMessage() = QString("Device mismatch. Found %1 input").arg(deviceSet->m_deviceSourceAPI->getHardwareId());
return 400; return 400;
} }
@ -846,11 +848,13 @@ int WebAPIAdapterGUI::devicesetDeviceSettingsPutPatch(
{ {
if (response.getTx() == 0) if (response.getTx() == 0)
{ {
error.init();
*error.getMessage() = QString("Tx device found but Rx device requested"); *error.getMessage() = QString("Tx device found but Rx device requested");
return 400; return 400;
} }
else if (deviceSet->m_deviceSinkAPI->getHardwareId() != *response.getDeviceHwType()) else if (deviceSet->m_deviceSinkAPI->getHardwareId() != *response.getDeviceHwType())
{ {
error.init();
*error.getMessage() = QString("Device mismatch. Found %1 output").arg(deviceSet->m_deviceSinkAPI->getHardwareId()); *error.getMessage() = QString("Device mismatch. Found %1 output").arg(deviceSet->m_deviceSinkAPI->getHardwareId());
return 400; return 400;
} }
@ -871,7 +875,6 @@ int WebAPIAdapterGUI::devicesetDeviceSettingsPutPatch(
{ {
error.init(); error.init();
*error.getMessage() = QString("There is no device set with index %1").arg(deviceSetIndex); *error.getMessage() = QString("There is no device set with index %1").arg(deviceSetIndex);
return 404; return 404;
} }
} }

View File

@ -929,11 +929,13 @@ int WebAPIAdapterSrv::devicesetDeviceSettingsPutPatch(
{ {
if (response.getTx() != 0) if (response.getTx() != 0)
{ {
error.init();
*error.getMessage() = QString("Rx device found but Tx device requested"); *error.getMessage() = QString("Rx device found but Tx device requested");
return 400; return 400;
} }
if (deviceSet->m_deviceSourceAPI->getHardwareId() != *response.getDeviceHwType()) if (deviceSet->m_deviceSourceAPI->getHardwareId() != *response.getDeviceHwType())
{ {
error.init();
*error.getMessage() = QString("Device mismatch. Found %1 input").arg(deviceSet->m_deviceSourceAPI->getHardwareId()); *error.getMessage() = QString("Device mismatch. Found %1 input").arg(deviceSet->m_deviceSourceAPI->getHardwareId());
return 400; return 400;
} }
@ -947,11 +949,13 @@ int WebAPIAdapterSrv::devicesetDeviceSettingsPutPatch(
{ {
if (response.getTx() == 0) if (response.getTx() == 0)
{ {
error.init();
*error.getMessage() = QString("Tx device found but Rx device requested"); *error.getMessage() = QString("Tx device found but Rx device requested");
return 400; return 400;
} }
else if (deviceSet->m_deviceSinkAPI->getHardwareId() != *response.getDeviceHwType()) else if (deviceSet->m_deviceSinkAPI->getHardwareId() != *response.getDeviceHwType())
{ {
error.init();
*error.getMessage() = QString("Device mismatch. Found %1 output").arg(deviceSet->m_deviceSinkAPI->getHardwareId()); *error.getMessage() = QString("Device mismatch. Found %1 output").arg(deviceSet->m_deviceSinkAPI->getHardwareId());
return 400; return 400;
} }