]> The Tcpdump Group git mirrors - libpcap/blobdiff - pcap.c
No, that's not an issue - it'll be a strdup() in any case, and safe to
[libpcap] / pcap.c
diff --git a/pcap.c b/pcap.c
index 1599d10b890e6dcf98a2eb2e23e8d22d8c3449d1..c9b461c46affcacaf7533f688e25b6d5dfa797af 100644 (file)
--- a/pcap.c
+++ b/pcap.c
@@ -190,14 +190,12 @@ pcap_create_common(const char *source, char *ebuf)
        p->fd = -1;     /* not opened yet */
 #endif 
 
-       if (source != NULL) {
-               p->opt.source = strdup(source);
-               if (p->opt.source == NULL) {
-                       snprintf(ebuf, PCAP_ERRBUF_SIZE, "malloc: %s",
-                           pcap_strerror(errno));
-                       free(p);
-                       return (NULL);
-               }
+       p->opt.source = strdup(source);
+       if (p->opt.source == NULL) {
+               snprintf(ebuf, PCAP_ERRBUF_SIZE, "malloc: %s",
+                   pcap_strerror(errno));
+               free(p);
+               return (NULL);
        }
 
        /*