libdvbv5: Allocate channel earlier
authorMauro Carvalho Chehab <m.chehab@samsung.com>
Mon, 1 Sep 2014 00:01:56 +0000 (21:01 -0300)
committerMauro Carvalho Chehab <m.chehab@samsung.com>
Mon, 1 Sep 2014 00:07:43 +0000 (21:07 -0300)
commitc75faa3dcb091b9b79efbbc084dbfcef9e5a89dc
treeb294710866763881eefd80f859ca3eff6169b2e0
parent0eddc63c1a877f1f28b9acda4975642912d32307
libdvbv5: Allocate channel earlier

As reported by Coverity:

CID 1228897 (#1 of 1): Explicit null dereferenced (FORWARD_NULL)14. var_deref_model: Passing null pointer channel to get_program_and_store, which dereferences it. [show details]
1129                        rc = get_program_and_store(parms, *dvb_file, dvb_scan_handler,
1130                                                   service_id, channel, NULL,
1131                                                   get_detected, get_nit);

Well, get_program_and_store() explicitly tests if channel is null or
not, but it does it too late.

Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
lib/libdvbv5/dvb-file.c