From 4051a953bd903444dd4ff72c29cd459e6d7b9d53 Mon Sep 17 00:00:00 2001 From: Sami Kerola Date: Thu, 20 Dec 2012 20:04:06 +0000 Subject: [PATCH] smatch scan: fix few warnings dhcpd-pools.h:79:17: warning: comma at end of enumerator list [-pedantic] hash.c:85 delete_lease() info: redundant null check on lease->ethernet calling free() Signed-off-by: Sami Kerola --- src/dhcpd-pools.h | 2 +- src/hash.c | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/dhcpd-pools.h b/src/dhcpd-pools.h index dda625f..f4c591f 100644 --- a/src/dhcpd-pools.h +++ b/src/dhcpd-pools.h @@ -76,7 +76,7 @@ union ipaddr_t { enum dhcp_version { VERSION_4, VERSION_6, - VERSION_UNKNOWN, + VERSION_UNKNOWN }; /*! \enum prefix_t * \brief Enumeration of interesting data in dhcpd.leases file, that has diff --git a/src/hash.c b/src/hash.c index d56d082..7b3f359 100644 --- a/src/hash.c +++ b/src/hash.c @@ -81,8 +81,7 @@ struct leases_t *find_lease(union ipaddr_t *addr) * \param lease Pointer to lease hash. */ void delete_lease(struct leases_t *lease) { - if (lease->ethernet != NULL) - free(lease->ethernet); + free(lease->ethernet); HASH_DEL(leases, lease); free(lease); }