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:
parent
ddea9de623
commit
8b04d928b6
2
pcap.c
2
pcap.c
|
@ -190,7 +190,6 @@ pcap_create_common(const char *source, char *ebuf)
|
||||||
p->fd = -1; /* not opened yet */
|
p->fd = -1; /* not opened yet */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (source != NULL) {
|
|
||||||
p->opt.source = strdup(source);
|
p->opt.source = strdup(source);
|
||||||
if (p->opt.source == NULL) {
|
if (p->opt.source == NULL) {
|
||||||
snprintf(ebuf, PCAP_ERRBUF_SIZE, "malloc: %s",
|
snprintf(ebuf, PCAP_ERRBUF_SIZE, "malloc: %s",
|
||||||
|
@ -198,7 +197,6 @@ pcap_create_common(const char *source, char *ebuf)
|
||||||
free(p);
|
free(p);
|
||||||
return (NULL);
|
return (NULL);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Default to "can't set rfmon mode"; if it's supported by
|
* Default to "can't set rfmon mode"; if it's supported by
|
||||||
|
|
|
@ -1361,7 +1361,7 @@ pcap_fopen_offline(FILE *fp, char *errbuf)
|
||||||
bpf_u_int32 magic;
|
bpf_u_int32 magic;
|
||||||
int linklen;
|
int linklen;
|
||||||
|
|
||||||
p = pcap_create_common(NULL, errbuf);
|
p = pcap_create_common("(savefile)", errbuf);
|
||||||
if (p == NULL)
|
if (p == NULL)
|
||||||
return (NULL);
|
return (NULL);
|
||||||
|
|
||||||
|
|
Reference in New Issue