aboutsummaryrefslogtreecommitdiffstats
path: root/lib/libdvbv5/dvb-dev-local.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@s-opensource.com>2016-08-07 12:08:48 (GMT)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2016-08-07 12:08:48 (GMT)
commitbeae34eb2d9f027c78e0a3ea0c505ab5e7ffc3f7 (patch)
tree5065b55e887230a555c9aad7ef6c7b1ff97bddbb /lib/libdvbv5/dvb-dev-local.c
parentfc85e68aed8ededb9774bf5edc6de495fc2f3b51 (diff)
libdvbv5: Fix some allocation issues
Valgrind reports about some allocation issues at dvb-dev. Address them. Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'lib/libdvbv5/dvb-dev-local.c')
-rw-r--r--lib/libdvbv5/dvb-dev-local.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/libdvbv5/dvb-dev-local.c b/lib/libdvbv5/dvb-dev-local.c
index 4632991..184ba6f 100644
--- a/lib/libdvbv5/dvb-dev-local.c
+++ b/lib/libdvbv5/dvb-dev-local.c
@@ -96,7 +96,7 @@ static int handle_device_change(struct dvb_device_priv *dvb,
dvb_dev->syspath = strdup(syspath);
p = udev_device_get_devnode(dev);
- if (!p) {
+ if (!p || !*p) {
dvb_logwarn(_("Can't get device node filename"));
goto err;
}
@@ -239,12 +239,12 @@ static int dvb_local_find(struct dvb_device_priv *dvb, int enable_monitor)
devices = udev_enumerate_get_list_entry(enumerate);
udev_list_entry_foreach(dev_list_entry, devices) {
- const char *path;
+ const char *syspath;
- path = udev_list_entry_get_name(dev_list_entry);
- dev = udev_device_new_from_syspath(dvb->udev, path);
+ syspath = udev_list_entry_get_name(dev_list_entry);
- handle_device_change(dvb, dev, path, "add");
+ dev = udev_device_new_from_syspath(dvb->udev, syspath);
+ handle_device_change(dvb, dev, syspath, "add");
udev_device_unref(dev);
}

Privacy Policy