diff options
author | jkim <jkim@FreeBSD.org> | 2006-04-21 19:35:03 +0000 |
---|---|---|
committer | jkim <jkim@FreeBSD.org> | 2006-04-21 19:35:03 +0000 |
commit | 782918fd852836566f16c74c69a96f9d7020e38b (patch) | |
tree | 031f2f7f031f5cfa3fa046b47c9f79f25abf70da /sys/dev/pci/pci_pci.c | |
parent | 76acdb63325b2b9476bb6a3735c611c5b1b5e5ab (diff) | |
download | FreeBSD-src-782918fd852836566f16c74c69a96f9d7020e38b.zip FreeBSD-src-782918fd852836566f16c74c69a96f9d7020e38b.tar.gz |
Free allocated environment variables after use.
Coverity ID: 366
Found by: Coverity Prevent
Diffstat (limited to 'sys/dev/pci/pci_pci.c')
-rw-r--r-- | sys/dev/pci/pci_pci.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/sys/dev/pci/pci_pci.c b/sys/dev/pci/pci_pci.c index 586379b..d156235 100644 --- a/sys/dev/pci/pci_pci.c +++ b/sys/dev/pci/pci_pci.c @@ -187,12 +187,20 @@ pcib_attach_common(device_t dev) { char *cp; - cp = getenv("smbios.planar.maker"); - if (cp == NULL || strncmp(cp, "Compal", 6) != 0) + if ((cp = getenv("smbios.planar.maker")) == NULL) break; - cp = getenv("smbios.planar.product"); - if (cp == NULL || strncmp(cp, "08A0", 4) != 0) + if (strncmp(cp, "Compal", 6) != 0) { + freeenv(cp); break; + } + freeenv(cp); + if ((cp = getenv("smbios.planar.product")) == NULL) + break; + if (strncmp(cp, "08A0", 4) != 0) { + freeenv(cp); + break; + } + freeenv(cp); if (sc->subbus < 0xa) { pci_write_config(dev, PCIR_SUBBUS_1, 0xa, 1); sc->subbus = pci_read_config(dev, PCIR_SUBBUS_1, 1); |