diff options
author | zhanghongtao <zhanghongtao22@huawei.com> | 2022-08-01 15:53:57 +0800 |
---|---|---|
committer | zhanghongtao <zhanghongtao22@huawei.com> | 2022-08-01 15:53:57 +0800 |
commit | b8de959615449fdf5b58ef08d881a77d397e86e2 (patch) | |
tree | 1af5d441268c8f9a1ce273dcf4837f17559cdcc8 | |
parent | f93c0dae5a837404a48ea7f3609c6c5c30691a7b (diff) | |
download | xorg-lib-libpciaccess-b8de959615449fdf5b58ef08d881a77d397e86e2.tar.gz |
pci_sys set NULL after free
Signed-off-by: zhanghongtao <zhanghongtao22@huawei.com>
-rw-r--r-- | src/freebsd_pci.c | 2 | ||||
-rw-r--r-- | src/netbsd_pci.c | 1 |
2 files changed, 3 insertions, 0 deletions
diff --git a/src/freebsd_pci.c b/src/freebsd_pci.c index 3794328..709bfb6 100644 --- a/src/freebsd_pci.c +++ b/src/freebsd_pci.c @@ -663,12 +663,14 @@ pci_system_freebsd_create( void ) if ( ioctl( pcidev, PCIOCGETCONF, &pciconfio ) == -1) { free( pci_sys ); + pci_sys = NULL; close( pcidev ); return errno; } if (pciconfio.status == PCI_GETCONF_ERROR ) { free( pci_sys ); + pci_sys = NULL; close( pcidev ); return EINVAL; } diff --git a/src/netbsd_pci.c b/src/netbsd_pci.c index 1f3bcea..b6a5ccd 100644 --- a/src/netbsd_pci.c +++ b/src/netbsd_pci.c @@ -942,6 +942,7 @@ pci_system_netbsd_create(void) for (i = 0; i < nbuses; i++) close(buses[i].fd); free(pci_sys); + pci_sys = NULL; return ENOMEM; } |