dect
/
libpcap
Archived
13
0
Fork 0

No, that's not an issue - it'll be a strdup() in any case, and safe to

free.  Revert previous change.
This commit is contained in:
Guy Harris 2009-08-11 22:10:51 -07:00
parent ddea9de623
commit 8b04d928b6
2 changed files with 7 additions and 9 deletions

2
pcap.c
View File

@ -190,7 +190,6 @@ 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",
@ -198,7 +197,6 @@ pcap_create_common(const char *source, char *ebuf)
free(p);
return (NULL);
}
}
/*
* Default to "can't set rfmon mode"; if it's supported by

View File

@ -1361,7 +1361,7 @@ pcap_fopen_offline(FILE *fp, char *errbuf)
bpf_u_int32 magic;
int linklen;
p = pcap_create_common(NULL, errbuf);
p = pcap_create_common("(savefile)", errbuf);
if (p == NULL)
return (NULL);