aboutsummaryrefslogtreecommitdiffstats
path: root/lib/libdvbv5/dvb-dev-local.c
diff options
context:
space:
mode:
authorRafaël Carré <funman@videolan.org>2017-11-14 11:15:26 (GMT)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2017-11-16 11:41:22 (GMT)
commit8e770f6216aef859a04f6843fa378b815401fe74 (patch)
treedb46ea8aeaa9478634b04246e7df5becbaf2cc5c /lib/libdvbv5/dvb-dev-local.c
parente9167a9ec371dcd2bfff159036ecb11e3b29eef7 (diff)
dvb_local_open(): strdup fname before calling dvb_fe_open_fname()
Issue spotted by valgrind: ==5290== Invalid free() / delete / delete[] / realloc() ==5290== at 0x4C30D3B: free (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) ==5290== by 0x4E54401: free_dvb_dev (dvb-dev.c:49) ==5290== by 0x4E5449A: dvb_dev_free_devices (dvb-dev.c:94) ==5290== by 0x4E547BA: dvb_dev_free (dvb-dev.c:121) ==5290== by 0x10881A: main (leak.c:26) ==5290== Address 0x5e55910 is 0 bytes inside a block of size 28 free'd ==5290== at 0x4C30D3B: free (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) ==5290== by 0x4E56504: dvb_v5_free (dvb-fe.c:85) ==5290== by 0x4E547B2: dvb_dev_free (dvb-dev.c:119) ==5290== by 0x10881A: main (leak.c:26) ==5290== Block was alloc'd at ==5290== at 0x4C2FB0F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) ==5290== by 0x5119C39: strdup (strdup.c:42) ==5290== by 0x4E55B42: handle_device_change (dvb-dev-local.c:137) ==5290== by 0x4E561DA: dvb_local_find (dvb-dev-local.c:323) ==5290== by 0x10880E: main (leak.c:10) Signed-off-by: Rafaël Carré <funman@videolan.org> 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.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/libdvbv5/dvb-dev-local.c b/lib/libdvbv5/dvb-dev-local.c
index 920e81f..b50b61b 100644
--- a/lib/libdvbv5/dvb-dev-local.c
+++ b/lib/libdvbv5/dvb-dev-local.c
@@ -440,7 +440,7 @@ static struct dvb_open_descriptor
*/
flags &= ~O_NONBLOCK;
- ret = dvb_fe_open_fname(parms, dev->path, flags);
+ ret = dvb_fe_open_fname(parms, strdup(dev->path), flags);
if (ret) {
free(open_dev);
return NULL;

Privacy Policy