Fix resource leak when using strdup(3).
Reported by: Coverity CID: 1357336 Sponsored by: iXsystems Inc.
This commit is contained in:
parent
6c8dae3cba
commit
93670f79d7
@ -2700,6 +2700,8 @@ pci_xhci_parse_opts(struct pci_xhci_softc *sc, char *opts)
|
|||||||
|
|
||||||
sc->ndevices++;
|
sc->ndevices++;
|
||||||
}
|
}
|
||||||
|
if (uopt != NULL)
|
||||||
|
free(uopt);
|
||||||
|
|
||||||
portsfinal:
|
portsfinal:
|
||||||
sc->portregs = calloc(XHCI_MAX_DEVS, sizeof(struct pci_xhci_portregs));
|
sc->portregs = calloc(XHCI_MAX_DEVS, sizeof(struct pci_xhci_portregs));
|
||||||
@ -2729,6 +2731,7 @@ done:
|
|||||||
free(devices);
|
free(devices);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
free(uopt);
|
||||||
return (sc->ndevices);
|
return (sc->ndevices);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user