As Coverity points, there are other places where this error also occurs.
Fix all of them.
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
int i;
d->lcn = malloc(d->length);
- if (!d->lcn)
+ if (!d->lcn) {
dvb_perror("Out of memory!");
+ return;
+ }
memcpy(d->lcn, p, d->length);
int i;
d->partial_reception = malloc(d->length);
- if (!d->partial_reception)
+ if (!d->partial_reception) {
dvb_perror("Out of memory!");
+ return;
+ }
memcpy(d->partial_reception, p, d->length);
struct dvb_table_nit_transport *transport;
transport = malloc(sizeof(struct dvb_table_nit_transport));
- if (!transport)
+ if (!transport) {
dvb_perror("Out of memory");
+ return;
+ }
memcpy(transport, p, size);
p += size;
dvb_log("Parsing table ID %d, program ID %d", tid, pid);
buf = malloc(DVB_MAX_PAYLOAD_PACKET_SIZE);
- if (!buf)
+ if (!buf) {
dvb_perror("Out of memory");
+ dvb_dmx_stop(dmx_fd);
+ return -1;
+ }
while (1) {
int available;
ssize_t buf_length = 0;