aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndré Roth <neolynx@gmail.com>2018-07-07 07:20:55 -0400
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>2019-03-17 06:46:41 -0300
commit0ac441ecf2ad2ec124e4b40a14697227dea515c3 (patch)
tree835ce3022b1270c0238301ca1f9e504adac67d99
parent1f4742dabefbeb7db0c0cc3a2dfc43075cafacc8 (diff)
libdvbv5: fix double free in dvb_fe_open_fnamestable-1.12
Since parms and fname is allocated outside of the function, do not free it. Use dvb_v5_free for freeing parms, it will free fname if required. Signed-off-by: André Roth <neolynx@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
-rw-r--r--lib/libdvbv5/dvb-fe.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/lib/libdvbv5/dvb-fe.c b/lib/libdvbv5/dvb-fe.c
index 1e29c9f0..f972fbf4 100644
--- a/lib/libdvbv5/dvb-fe.c
+++ b/lib/libdvbv5/dvb-fe.c
@@ -176,7 +176,7 @@ struct dvb_v5_fe_parms *dvb_fe_open_flags(int adapter, int frontend,
ret = dvb_fe_open_fname(parms, fname, flags);
if (ret < 0) {
- free(parms);
+ dvb_v5_free(parms);
return NULL;
}
@@ -198,9 +198,7 @@ int dvb_fe_open_fname(struct dvb_v5_fe_parms_priv *parms, char *fname,
if (xioctl(fd, FE_GET_INFO, &parms->p.info) == -1) {
dvb_perror("FE_GET_INFO");
- dvb_v5_free(parms);
close(fd);
- free(fname);
return -errno;
}
@@ -282,7 +280,6 @@ int dvb_fe_open_fname(struct dvb_v5_fe_parms_priv *parms, char *fname,
}
if (!parms->p.num_systems) {
dvb_logerr(_("delivery system not detected"));
- dvb_v5_free(parms);
close(fd);
return -EINVAL;
}
@@ -293,7 +290,6 @@ int dvb_fe_open_fname(struct dvb_v5_fe_parms_priv *parms, char *fname,
dtv_prop.props = parms->dvb_prop;
if (xioctl(fd, FE_GET_PROPERTY, &dtv_prop) == -1) {
dvb_perror("FE_GET_PROPERTY");
- dvb_v5_free(parms);
close(fd);
return -errno;
}
@@ -303,7 +299,6 @@ int dvb_fe_open_fname(struct dvb_v5_fe_parms_priv *parms, char *fname,
if (parms->p.num_systems == 0) {
dvb_logerr(_("driver returned 0 supported delivery systems!"));
- dvb_v5_free(parms);
close(fd);
return -EINVAL;
}

Privacy Policy