From: Mauro Carvalho Chehab Date: Mon, 18 Nov 2013 09:52:53 +0000 (-0200) Subject: libdvbv5/dvb-scan: avoid memory leak on table read timeout X-Git-Tag: v4l-utils-1.2.0~331 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=effacf97f1cb80ef2e03744b1aad8a16c08791ed;p=platform%2Fupstream%2Fv4l-utils.git libdvbv5/dvb-scan: avoid memory leak on table read timeout Free buf, if table read fails with timeout. Signed-off-by: Mauro Carvalho Chehab --- diff --git a/lib/libdvbv5/dvb-scan.c b/lib/libdvbv5/dvb-scan.c index 36c79c1..0eba268 100644 --- a/lib/libdvbv5/dvb-scan.c +++ b/lib/libdvbv5/dvb-scan.c @@ -125,6 +125,7 @@ int dvb_read_section_with_id(struct dvb_v5_fe_parms *parms, int dmx_fd, } while (available < 0 && errno == EOVERFLOW); if (parms->abort) { + free(buf); if (tbl) free(tbl); return 0; @@ -132,6 +133,7 @@ int dvb_read_section_with_id(struct dvb_v5_fe_parms *parms, int dmx_fd, if (available <= 0) { dvb_logerr("dvb_read_section: no data read on pid %x table %x", pid, tid); + free(buf); if (tbl) free(tbl); return -1;