Don't free blockdata for negative DS cache entries.
diff --git a/src/cache.c b/src/cache.c
index 3ebb49d..f4a24b3 100644
--- a/src/cache.c
+++ b/src/cache.c
@@ -183,7 +183,7 @@
       else
 	blockdata_free(crecp->addr.key.keydata);
     }
-  else if (crecp->flags & F_DS)
+  else if ((crecp->flags & F_DS) && !(crecp->flags & F_NEG))
     blockdata_free(crecp->addr.ds.keydata);
 }
 #endif
diff --git a/src/dnssec.c b/src/dnssec.c
index 2d00570..5672ebe 100644
--- a/src/dnssec.c
+++ b/src/dnssec.c
@@ -353,7 +353,7 @@
       l[len] = '.';
     }
 
-  if (l != name)
+  if ((char *)l != name)
     *(l-1) = 0;
 }