1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-12-28 07:51:19 +01:00

Merge pull request #6262 from smlng/pr/cppcheck/fix_nhdp_address

cppcheck: fix warning in nhdp_address
This commit is contained in:
Cenk Gündoğan 2016-12-27 16:26:10 +01:00 committed by GitHub
commit 5fd26e28e7

View File

@ -89,15 +89,13 @@ void nhdp_decrement_addr_usage(nhdp_addr_t *addr)
/* Decrement usage count and delete address if no longer used */
if (addr) {
addr->usg_count--;
if (addr->usg_count <= 0) {
if (addr->usg_count == 0) {
/* Free address space if address is no longer used */
LL_DELETE(nhdp_addr_db_head, addr);
free(addr->addr);
free(addr);
}
}
mutex_unlock(&mtx_addr_access);
}