]> The Tcpdump Group git mirrors - tcpdump/blobdiff - tcpdump.c
Clean up whitespaces
[tcpdump] / tcpdump.c
index 7fcace9c89aa608798b55a16bd224d3c749579a2..3b4d84f9ae85e6ad7ebc59d108e4971d5c63be0a 100644 (file)
--- a/tcpdump.c
+++ b/tcpdump.c
@@ -1156,6 +1156,9 @@ _U_
                 */
                endp++; /* Include the trailing / in the URL; pcap_findalldevs_ex() requires it */
                host_url = malloc(endp - url + 1);
+               if (host_url == NULL && (endp - url + 1) > 0)
+                       error("Invalid allocation for host");
+
                memcpy(host_url, url, endp - url);
                host_url[endp - url] = '\0';
                status = pcap_findalldevs_ex(host_url, NULL, &devlist, ebuf);