Cleanup potential fault in eth_close if eth_close is called with a NULL argument.
This commit is contained in:
parent
93f14f76fb
commit
3ccd66d546
1 changed files with 2 additions and 1 deletions
|
@ -1713,12 +1713,13 @@ t_stat eth_close(ETH_DEV* dev)
|
|||
{
|
||||
char* msg = "Eth: closed %s\r\n";
|
||||
pcap_t *pcap;
|
||||
int pcap_fd = dev->fd_handle;
|
||||
int pcap_fd;
|
||||
|
||||
/* make sure device exists */
|
||||
if (!dev) return SCPE_UNATT;
|
||||
|
||||
/* close the device */
|
||||
pcap_fd = dev->fd_handle; /* save handle to possibly close later */
|
||||
pcap = (pcap_t *)dev->handle;
|
||||
dev->handle = NULL;
|
||||
dev->fd_handle = 0;
|
||||
|
|
Loading…
Add table
Reference in a new issue