-diff --git a/Makefile b/Makefile
-index 2910320b6452..0a76ce3c5154 100644
---- a/Makefile
-+++ b/Makefile
-@@ -73,7 +73,7 @@ objs = cache.o rfc1035.o util.o option.o forward.o network.o \
- dnsmasq.o dhcp.o lease.o rfc2131.o netlink.o dbus.o bpf.o \
- helper.o tftp.o log.o conntrack.o dhcp6.o rfc3315.o \
- dhcp-common.o outpacket.o radv.o slaac.o auth.o ipset.o \
-- domain.o dnssec.o blockdata.o tables.o loop.o inotify.o
-+ domain.o dnssec.o blockdata.o tables.o loop.o inotify.o isc.o
-
- hdrs = dnsmasq.h config.h dhcp-protocol.h dhcp6-protocol.h \
- dns-protocol.h radv-protocol.h ip6addr.h
-diff --git a/src/cache.c b/src/cache.c
-index 117ae279fd4e..6ee7ee362e6c 100644
---- a/src/cache.c
-+++ b/src/cache.c
+--- a/src/cache.c Wed Dec 16 19:24:12 2015
++++ b/src/cache.c Wed Dec 16 19:37:37 2015
@@ -17,7 +17,7 @@
#include "dnsmasq.h"
static struct crec *dhcp_spare = NULL;
#endif
static struct crec *new_chain = NULL;
-@@ -222,6 +222,9 @@ static void cache_free(struct crec *crecp)
+@@ -217,6 +217,9 @@
crecp->flags &= ~F_BIGNAME;
}
#ifdef HAVE_DNSSEC
cache_blockdata_free(crecp);
#endif
-@@ -1151,7 +1154,7 @@ void cache_reload(void)
+@@ -1138,7 +1141,7 @@
}
struct in_addr a_record_from_hosts(char *name, time_t now)
{
struct crec *crecp = NULL;
-@@ -1229,7 +1232,7 @@ void cache_add_dhcp_entry(char *host_name, int prot,
- addrlen = sizeof(struct in6_addr);
- }
- #endif
--
-+
- inet_ntop(prot, host_address, daemon->addrbuff, ADDRSTRLEN);
-
- while ((crec = cache_find_by_name(crec, host_name, 0, flags | F_CNAME)))
-@@ -1294,7 +1297,11 @@ void cache_add_dhcp_entry(char *host_name, int prot,
+@@ -1281,7 +1284,11 @@
else
crec->ttd = ttd;
crec->addr.addr = *host_address;
crec->uid = next_uid();
cache_hash(crec);
-diff --git a/src/dnsmasq.c b/src/dnsmasq.c
-index e903a24c8105..eefc7f939933 100644
---- a/src/dnsmasq.c
-+++ b/src/dnsmasq.c
-@@ -970,6 +970,11 @@ int main (int argc, char **argv)
+--- a/src/dnsmasq.c Thu Jul 30 20:59:06 2015
++++ b/src/dnsmasq.c Wed Dec 16 19:38:32 2015
+@@ -1017,6 +1017,11 @@
poll_resolv(0, daemon->last_resolv != 0, now);
daemon->last_resolv = now;
}
#endif
-diff --git a/src/dnsmasq.h b/src/dnsmasq.h
-index 89e758b56a0a..c5edd6fdf7f5 100644
---- a/src/dnsmasq.h
-+++ b/src/dnsmasq.h
-@@ -1502,3 +1502,8 @@ void inotify_dnsmasq_init();
- int inotify_check(time_t now);
- void set_dynamic_inotify(int flag, int total_size, struct crec **rhash, int revhashsz);
- #endif
-+
+--- a/src/dnsmasq.h Wed Dec 16 19:24:12 2015
++++ b/src/dnsmasq.h Wed Dec 16 19:40:11 2015
+@@ -1516,6 +1516,11 @@
+ void poll_listen(int fd, short event);
+ int do_poll(int timeout);
+
+/* isc.c */
+#ifdef HAVE_ISC_READER
+void load_dhcp(time_t now);
+#endif
-diff --git a/src/isc.c b/src/isc.c
-new file mode 100644
-index 000000000000..51064426f17f
---- /dev/null
-+++ b/src/isc.c
-@@ -0,0 +1,251 @@
++
+ /* rrfilter.c */
+ size_t rrfilter(struct dns_header *header, size_t plen, int mode);
+ u16 *rrfilter_desc(int type);
+ int expand_workspace(unsigned char ***wkspc, int *szp, int new);
+-
+--- /dev/null Wed Dec 16 19:48:08 2015
++++ b/src/isc.c Wed Dec 16 19:41:35 2015
+@@ -0,0 +1,266 @@
+/* dnsmasq is Copyright (c) 2014 John Volpe, Simon Kelley and
+ Michael Tremer
+
+ Michael Tremer.
+*/
+
++
++#define _GNU_SOURCE
++
++#include <assert.h>
++#include <stdio.h>
++
+#include "dnsmasq.h"
+
+#ifdef HAVE_ISC_READER
+
+static struct isc_dhcp_lease* dhcp_lease_new(const char* hostname) {
+ struct isc_dhcp_lease* lease = whine_malloc(sizeof(*lease));
++ if (!lease)
++ return NULL;
+
+ lease->name = strdup(hostname);
+ if (daemon->domain_suffix) {
-+ asprintf(&lease->fqdn, "%s.%s", hostname, daemon->domain_suffix);
++ int r = asprintf(&lease->fqdn, "%s.%s", hostname, daemon->domain_suffix);
++
++ // Handle OOM
++ if (r < 0) {
++ free(lease);
++ return NULL;
++ }
+ }
+ lease->expires = 0;
+ lease->next = NULL;
+ // and append it to the list.
+ if (!lease) {
+ lease = dhcp_lease_new(hostname);
++ assert(lease);
+
+ lease->next = leases;
+ leases = lease;
+}
+
+#endif
-diff --git a/src/option.c b/src/option.c
-index cb4e76ba0aa2..f6420fcbb7ab 100644
---- a/src/option.c
-+++ b/src/option.c
-@@ -1693,7 +1693,7 @@ static int one_opt(int option, char *arg, char *errstr, char *gen_err, int comma
+--- a/src/option.c Wed Dec 16 19:24:12 2015
++++ b/src/option.c Wed Dec 16 19:42:48 2015
+@@ -1771,7 +1771,7 @@
ret_err(_("bad MX target"));
break;
case 'l': /* --dhcp-leasefile */
daemon->lease_file = opt_string_alloc(arg);
break;
+--- a/Makefile Wed Dec 16 19:24:12 2015
++++ b/Makefile Wed Dec 16 19:28:45 2015
+@@ -74,7 +74,7 @@
+ helper.o tftp.o log.o conntrack.o dhcp6.o rfc3315.o \
+ dhcp-common.o outpacket.o radv.o slaac.o auth.o ipset.o \
+ domain.o dnssec.o blockdata.o tables.o loop.o inotify.o \
+- poll.o rrfilter.o edns0.o arp.o
++ poll.o rrfilter.o edns0.o arp.o isc.o
+
+ hdrs = dnsmasq.h config.h dhcp-protocol.h dhcp6-protocol.h \
+ dns-protocol.h radv-protocol.h ip6addr.h