fix potential null pointer deref when packets are forged
[project/mdnsd.git] / util.c
diff --git a/util.c b/util.c
index e68e9c9..f0517b4 100644 (file)
--- a/util.c
+++ b/util.c
@@ -16,8 +16,6 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <sys/utsname.h>
-#include <linux/if.h>
-#include <linux/sockios.h>
 #include <arpa/inet.h>
 
 #include <unistd.h>
@@ -75,14 +73,3 @@ void get_hostname(void)
        snprintf(mdns_hostname, sizeof(mdns_hostname), "%s", utsname.nodename);
        snprintf(mdns_hostname_local, sizeof(mdns_hostname_local), "%s.local", utsname.nodename);
 }
-
-void*
-memdup(const void *d, int l)
-{
-       void *r = malloc(l);
-       if (!r)
-               return NULL;
-       memcpy(r, d, l);
-       return r;
-}
-