Fix resource leak when using strdup(3).

Reported by:	Coverity
CID:		1357336
Sponsored by:	iXsystems Inc.
This commit is contained in:
Marcelo Araujo 2018-11-02 08:01:42 +00:00
parent 6c8dae3cba
commit 93670f79d7

View File

@ -2700,6 +2700,8 @@ pci_xhci_parse_opts(struct pci_xhci_softc *sc, char *opts)
sc->ndevices++;
}
if (uopt != NULL)
free(uopt);
portsfinal:
sc->portregs = calloc(XHCI_MAX_DEVS, sizeof(struct pci_xhci_portregs));
@ -2729,6 +2731,7 @@ done:
free(devices);
}
}
free(uopt);
return (sc->ndevices);
}