libdvr: LGE Coverity aml dvr report [1/1]
PD#TV-61227
Problem:
LGE report Coverity errors of libdvr.
Solution:
Fix 19 out of 42 errors reported by Coverity for the 2nd round
including BUFFER_SIZE, CHECKED_RETURN, LOCK, NO_EFFECT, PRINTF_ARGS,
RESOURCE_LEAK, STRING_NULL, UNINIT, UNUSED_VALUE and USE_AFTER_FREE
Verify:
Locally tested OK in AH212 RDK environment.
Signed-off-by: Wentao.MA <wentao.ma@amlogic.com>
Change-Id: I0e4e6aa96b73220ee79163c8427eaf9cb9c38d62
diff --git a/src/dvb_utils.c b/src/dvb_utils.c
index aecf126..6e638b8 100644
--- a/src/dvb_utils.c
+++ b/src/dvb_utils.c
@@ -71,7 +71,7 @@
char node2[20] = {0};
int fd = -1;
int fd2 = -1;
- int r;
+ int r = 0;
snprintf(node, sizeof(node), "/sys/class/stb/demux%d_source", dmx_idx);
snprintf(node2, sizeof(node2), "/dev/dvb0.demux%d", dmx_idx);
@@ -212,7 +212,8 @@
int fd = -1;
int fd2 = -1;
char buf[32] = {0};
- int r, source_no;
+ int r = 0;
+ int source_no = 0;
snprintf(node, sizeof(node), "/sys/class/stb/demux%d_source", dmx_idx);
snprintf(node2, sizeof(node2), "/dev/dvb0.demux%d", dmx_idx);