aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcus Müller <marcus.mueller@ettus.com>2016-03-02 20:12:06 +0100
committerMartin Braun <martin.braun@ettus.com>2016-03-03 11:54:54 -0800
commit59433663b1de1fb142d77da52aab99763577f79a (patch)
treee151e49e854b295efc68cf94b33e82c7c03b55ab
parentf212665812b9d25b28a254bcb8d0203d80dd77c1 (diff)
downloaduhd-59433663b1de1fb142d77da52aab99763577f79a.tar.gz
uhd-59433663b1de1fb142d77da52aab99763577f79a.tar.bz2
uhd-59433663b1de1fb142d77da52aab99763577f79a.zip
e300: Fixed a memory leak in udev code
When querying temp mboard sensor on e300, sysfs attributes are read through udev.
-rw-r--r--host/lib/usrp/e300/e300_sysfs_hooks.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/host/lib/usrp/e300/e300_sysfs_hooks.cpp b/host/lib/usrp/e300/e300_sysfs_hooks.cpp
index ee2ac21d7..7bd1d6d7e 100644
--- a/host/lib/usrp/e300/e300_sysfs_hooks.cpp
+++ b/host/lib/usrp/e300/e300_sysfs_hooks.cpp
@@ -65,10 +65,11 @@ std::string e300_get_sysfs_attr(const std::string &node, const std::string &attr
dev = udev_device_new_from_syspath(udev, path);
retstring = udev_device_get_sysattr_value(dev, attr.c_str());
- if (retstring.size())
- break;
udev_device_unref(dev);
+
+ if (retstring.size())
+ break;
}
udev_enumerate_unref(enumerate);