As Coverity points, there are other places where this error also occurs.
Fix them.
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
return;
}
- current = malloc(size);
- if (!current)
+ current = calloc(1, size);
+ if (!current) {
dvb_perror("Out of memory");
+ return;
+ }
ptr += dvb_desc_init(ptr, current); /* the standard header was read */
init(parms, ptr, current);
if (!*head_desc)
struct dvb_table_pat_program *pgm;
pgm = malloc(sizeof(struct dvb_table_pat_program));
- if (!pgm)
+ if (!pgm) {
dvb_perror("Out of memory");
+ return;
+ }
memcpy(pgm, p, size);
p += size;