From: Adam Sutton Date: Sun, 3 Feb 2013 13:22:21 +0000 (+0000) Subject: Correct some mistkaes picked up by static analysis. X-Git-Tag: v3.5~27 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a582fe7c7b4bd1df5fe160e7c8d941e4d15e39cb;p=thirdparty%2Ftvheadend.git Correct some mistkaes picked up by static analysis. Thanks to seo for pointing these out. --- diff --git a/src/cwc.c b/src/cwc.c index 58c1e08b9..3c0b5ae93 100644 --- a/src/cwc.c +++ b/src/cwc.c @@ -1857,7 +1857,8 @@ cwc_emm_cryptoworks(cwc_t *cwc, uint8_t *data, int len) cwc_send_msg(cwc, composed, elen + 12, 0, 1); free(composed); free(tmp); - } + } else if (tmp) + free(tmp); cwc->cwc_cryptoworks_emm.shared_emm = NULL; cwc->cwc_cryptoworks_emm.shared_len = 0; } diff --git a/src/dvb/dvb_adapter.c b/src/dvb/dvb_adapter.c index e4b30c51c..861c11178 100644 --- a/src/dvb/dvb_adapter.c +++ b/src/dvb/dvb_adapter.c @@ -520,6 +520,7 @@ tda_add(int adapter_num) dirp = opendir(path); if (!dirp) return; + closedir(dirp); /* Check each frontend */ // Note: this algo will fail if there are really exotic variations diff --git a/src/main.c b/src/main.c index 402612131..61cebd72b 100644 --- a/src/main.c +++ b/src/main.c @@ -283,6 +283,7 @@ show_usage } tok = strtok(NULL, "\n"); } + free(desc); } } printf("\n");