Check for NULL dhcp pointers in dhcp_free and dhcp_release.

---
 src/dhcp.c |   9 ++++++++
 1 files changed, 8 insertions(+)

diff --git a/src/dhcp.c b/src/dhcp.c
index ab8ee5a..cddee25 100644
--- a/src/dhcp.c
+++ b/src/dhcp.c
@@ -50,6 +50,11 @@ static GHashTable *network_table;
 
 static void dhcp_free(struct connman_dhcp *dhcp)
 {
+       DBG("dhcp %p", dhcp);
+
+       if (dhcp == NULL)
+               return;
+
        g_strfreev(dhcp->nameservers);
        g_free(dhcp->timeserver);
        g_free(dhcp->pac);
@@ -414,7 +419,9 @@ static int dhcp_release(struct connman_dhcp *dhcp)
 {
        DBG("dhcp %p", dhcp);
 
+       if (dhcp == NULL)
+               return -EINVAL;
+
        if (dhcp->dhcp_client == NULL)
                return 0;
 
--
1.7.5
_______________________________________________
connman mailing list
[email protected]
http://lists.connman.net/listinfo/connman

Reply via email to