This is an automatic generated email to let you know that the following patch 
were queued at the 
http://git.linuxtv.org/v4l-utils.git tree:

Subject: dvb-file: fix memory-deallocation bug
Author:  Mauro Carvalho Chehab <m.che...@samsung.com>
Date:    Fri Jul 25 22:45:55 2014 -0300

channel should be a pointer, as it will be allocated internally,
otherwise we'll have a double de-allocation when freeing DVB
scan structures.

Signed-off-by: Mauro Carvalho Chehab <m.che...@samsung.com>

 lib/libdvbv5/dvb-file.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

---

http://git.linuxtv.org/v4l-utils.git?a=commitdiff;h=b6e89ace327351c3f7b4da7205f1641fea959a8f

diff --git a/lib/libdvbv5/dvb-file.c b/lib/libdvbv5/dvb-file.c
index 8df348e..326871d 100644
--- a/lib/libdvbv5/dvb-file.c
+++ b/lib/libdvbv5/dvb-file.c
@@ -1022,12 +1022,12 @@ static int get_program_and_store(struct dvb_v5_fe_parms 
*parms,
                entry->props[j].cmd = parms->dvb_prop[j].cmd;
                entry->props[j].u.data = parms->dvb_prop[j].u.data;
 
-               if (!channel && entry->props[j].cmd == DTV_FREQUENCY)
+               if (!*channel && entry->props[j].cmd == DTV_FREQUENCY)
                        freq = parms->dvb_prop[j].u.data;
        }
        entry->n_props = parms->n_props;
 
-       if (!channel) {
+       if (!*channel) {
                r = asprintf(&channel, "%.2fMHz#%d", freq/1000000., service_id);
                if (r < 0)
                        dvb_perror("asprintf");
@@ -1113,8 +1113,9 @@ int store_dvb_channel(struct dvb_file **dvb_file,
        if (!dvb_scan_handler->sdt) {
                int i;
 
-               dvb_logerr("no SDT table - storing channels without their 
names");
+               dvb_log("WARNING: no SDT table - storing channels without their 
names");
                for (i = 0; i < dvb_scan_handler->num_program; i++) {
+                       char *channel = NULL;
                        unsigned service_id;
 
                        if (!dvb_scan_handler->program[i].pmt)
@@ -1123,7 +1124,7 @@ int store_dvb_channel(struct dvb_file **dvb_file,
                        service_id = 
dvb_scan_handler->program[i].pat_pgm->service_id;
 
                        rc = get_program_and_store(parms, *dvb_file, 
dvb_scan_handler,
-                                                  service_id, NULL, NULL,
+                                                  service_id, channel, NULL,
                                                   get_detected, get_nit);
                        if (rc < 0)
                                return rc;

_______________________________________________
linuxtv-commits mailing list
linuxtv-commits@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits

Reply via email to