mirror of
https://bitbucket.org/smil3y/kdelibs.git
synced 2025-02-23 18:32:49 +00:00
solid: plug memory leak in devinfo backend
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
7ecb69bd0a
commit
5c2c878f82
1 changed files with 6 additions and 5 deletions
|
@ -76,18 +76,19 @@ DevinfoDevice::DevinfoDevice(const QString &device)
|
|||
return;
|
||||
}
|
||||
|
||||
const QByteArray devicename = m_device.right(m_device.size() - qstrlen(DEVINFO_UDI_PREFIX) - 1).toLatin1();
|
||||
DeviceArgumentType* getDeviceArg = new DeviceArgumentType(devicename, m_properties);
|
||||
|
||||
struct devinfo_dev *root = devinfo_handle_to_device(DEVINFO_ROOT_DEVICE);
|
||||
if (root) {
|
||||
const QByteArray devicename = m_device.right(m_device.size() - qstrlen(DEVINFO_UDI_PREFIX) - 1).toLatin1();
|
||||
DeviceArgumentType* getDeviceArg = new DeviceArgumentType(devicename, m_properties);
|
||||
|
||||
devinfo_foreach_device_child(root, getDeviceProperties, getDeviceArg);
|
||||
|
||||
m_properties = getDeviceArg->second;
|
||||
delete getDeviceArg;
|
||||
} else {
|
||||
qWarning() << "no root device";
|
||||
return;
|
||||
}
|
||||
m_properties = getDeviceArg->second;
|
||||
delete getDeviceArg;
|
||||
|
||||
const QByteArray pnpinfo = m_properties[DevinfoDevice::DevicePnPInfo];
|
||||
m_pnpinfo[DevinfoDevice::PnPVendor] = getPnPInfo(pnpinfo, "vendor");
|
||||
|
|
Loading…
Add table
Reference in a new issue