Bugfix/add makefile lint fix warnings (#39)

* fix warnings indicated by scan-build lint tool

* add lint target to makefile using scan-build tool

* add lint into build script stages (note: uses scan-build-7)

* fix potential use of memory after it is freed
This commit is contained in:
Steve Karg
2020-01-28 18:48:29 -06:00
committed by GitHub
parent f8ce70470c
commit 914f502cff
18 changed files with 157 additions and 105 deletions
+8 -6
View File
@@ -234,13 +234,15 @@ void address_mac_init(BACNET_MAC_ADDRESS *mac, uint8_t *adr, uint8_t len)
{
uint8_t i = 0;
if (mac && adr && (len <= sizeof(mac->adr))) {
for (i = 0; i < len; i++) {
mac->adr[i] = adr[i];
if (mac) {
if (adr && (len <= sizeof(mac->adr))) {
for (i = 0; i < len; i++) {
mac->adr[i] = adr[i];
}
mac->len = len;
} else {
mac->len = 0;
}
mac->len = len;
} else {
mac->len = 0;
}
}